Home > Mobile >  Return key to continue running in the background where the code should be added
Return key to continue running in the background where the code should be added

Time:09-30

I only this. Smali files,
Whether to add in this file,
Do not, however, consult the teacher,
My code is as follows:

. Class public Lcom/ofthesource/mywebview/mywebview; 
The super Landroid/app/Activity;
The source "mywebview. Java
"

# the instance fields
The field mWebView: Landroid/its/WebView;


# direct the methods
The method of public constructor & lt; init> (V)
. The locals 0

The prologue
. The line 7
Invoke - direct {p0}, Landroid/app/Activity; -> (V)

The return - void
The end method


# virtual methods
The method public onCreate (Landroid/OS/Bundle) V
Locals 2
The param (p1, "savedInstanceState" # Landroid/OS/Bundle;

The prologue
The line 15
Invoke - super {p0, p1}, the Landroid/app/Activity; -> OnCreate (Landroid/OS/Bundle;) V

16. The line
Const/high16 where v0, 0 x7f030000

Invoke - virtual {p0, where v0}, Lcom/ofthesource/mywebview/mywebview; -> The setContentView (I) V

The line 18
Const/high16 where v0, 0 x7f050000

Invoke - virtual {p0, where v0}, Lcom/ofthesource/mywebview/mywebview; -> The findViewById (I) Landroid/view/view;

Move - result - object where v0

Check - cast where v0, Landroid/its/WebView;

Iput - object where v0, p0, Lcom/ofthesource/mywebview/mywebview; -> MWebView: Landroid/its/WebView;

The line 19
Iget struck in - object where v0, p0, Lcom/ofthesource/mywebview/mywebview; -> MWebView: Landroid/its/WebView;

Invoke - virtual {where v0}, Landroid/its/WebView; -> Landroid getSettings ()/its/WebSettings;

Move - result - object where v0

Const/4 v1, 0 x1

Invoke - virtual {where v0, v1}, the Landroid/its/WebSettings; -> SetJavaScriptEnabled (Z) V

The line 20
Iget struck in - object where v0, p0, Lcom/ofthesource/mywebview/mywebview; -> MWebView: Landroid/its/WebView;

Const - string v1, "http://www.baidu.com"

Invoke - virtual {where v0, v1}, the Landroid/its/WebView; -> LoadUrl (Ljava/lang/String;) V

The line 21
The return - void
The end method

CodePudding user response:

This is an initialization of the webview activity interface, smali is decompiled, project can't use, unless you rewrite,

Return key to continue running in the background code is what the devil

CodePudding user response:

I this smali folder only a few files:

The only 11 k,
I just want to do it:
A call to a web page, and then press the return key is not quit, still stay in the background,
After press the return key, the content of the form input in the next time you open this app is still in (similar to WeChat),

CodePudding user response:

reference 1/f, dear Joe reply:
this is an initialization of the webview activity interface, smali is decompiled, project can't use, unless you rewrite,

Return key to continue running in the background code is what ghost

I now the question is, press the return key to exit,
Can you achieve? The teacher,

CodePudding user response:

Yi
reference 3 floor response:
Quote: reference 1/f, dear Joe reply:

This is an initialization of the webview activity interface, smali is decompiled, project can't use, unless you rewrite,

Return key to continue running in the background code is what ghost

I now the question is, press the return key to exit,
Can you achieve? The teacher,

If this is only an activity in the stack, then press the return key exit is must of,
Can't figure out, the response of the interception return key events,
Rewrite OnBackPressed () method, and do nothing, just good

CodePudding user response:

Return key was going to destroy the activity
You press the home button is the effect you want, must return key and the effect, make a save yourself,,

CodePudding user response:

Add this code didn't work

 public Boolean onKeyDown (int keyCode, KeyEvent event) {
If (keyCode==KeyEvent. KEYCODE_BACK) {
MoveTaskToBack (false);
return true;
}
Return super. OnKeyDown (keyCode, event);
}

@ Override
Public void onBackPressed () {
MoveTaskToBack (false);
Super. OnBackPressed ();

}

CodePudding user response:

reference 5 floor gxh_apologize reply:
return key was going to destroy the activity
You press the home button is the effect you want, must return key and the effect, make a save yourself,,

Home button need long press to just go, sometimes accidentally press the wrong
Moreover, my mobile phone no home button and the return key is the same
  • Related