-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
185 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Android/example/src/main/java/com/lynx/example/DebugActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.lynx.example; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
/** | ||
* Created by dli on 2018/5/14. | ||
*/ | ||
|
||
public class DebugActivity extends Activity { | ||
|
||
private Button mButtom; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
mButtom = new Button(this); | ||
this.setContentView(mButtom); | ||
|
||
mButtom.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Log.d("lynx", "test"); | ||
Bundle bundle = new Bundle(); | ||
bundle.putString("page", "HomeDemo.vue"); | ||
Intent intent = new Intent(DebugActivity.this, MainActivity.class); | ||
intent.putExtras(bundle); | ||
startActivity(intent); | ||
} | ||
}); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ org.gradle.jvmargs=-Xmx1536m | |
# org.gradle.parallel=true | ||
|
||
# v8 or jsc | ||
js_engine_type=v8 | ||
js_engine_type=jsc |
57 changes: 57 additions & 0 deletions
57
Android/sdk/src/main/java/com/lynx/base/InputMethodManagerLeakHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.lynx.base; | ||
|
||
import android.content.Context; | ||
import android.view.inputmethod.InputMethodManager; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
|
||
public class InputMethodManagerLeakHelper { | ||
public static void resolve(Context context) { | ||
if (context == null) { | ||
return; | ||
} | ||
try { | ||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); | ||
if (imm == null) { | ||
return; | ||
} | ||
Object obj_get = null; | ||
Field f_mCurRootView = imm.getClass().getDeclaredField("mCurRootView"); | ||
Field f_mServedView = imm.getClass().getDeclaredField("mServedView"); | ||
Field f_mNextServedView = imm.getClass().getDeclaredField("mNextServedView"); | ||
Field f_mLastSrvView = imm.getClass().getDeclaredField("mLastSrvView"); | ||
if (f_mCurRootView.isAccessible() == false) { | ||
f_mCurRootView.setAccessible(true); | ||
} | ||
obj_get = f_mCurRootView.get(imm); | ||
if (obj_get != null) { // 不为null则置为空 | ||
f_mCurRootView.set(imm, null); | ||
} | ||
if (f_mServedView.isAccessible() == false) { | ||
f_mServedView.setAccessible(true); | ||
} | ||
obj_get = f_mServedView.get(imm); | ||
if (obj_get != null) { // 不为null则置为空 | ||
f_mServedView.set(imm, null); | ||
} | ||
if (f_mNextServedView.isAccessible() == false) { | ||
f_mNextServedView.setAccessible(true); | ||
} | ||
obj_get = f_mNextServedView.get(imm); | ||
if (obj_get != null) { // 不为null则置为空 | ||
f_mNextServedView.set(imm, null); | ||
} | ||
|
||
if (f_mLastSrvView.isAccessible() == false) { | ||
f_mLastSrvView.setAccessible(true); | ||
} | ||
obj_get = f_mLastSrvView.get(imm); | ||
if (obj_get != null) { // 不为null则置为空 | ||
f_mLastSrvView.set(imm, null); | ||
} | ||
} catch (Throwable t) { | ||
t.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.