You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
Context: handle startActivity() always asynchron
This commit is contained in:
@@ -661,7 +661,7 @@ public class Context extends Object {
|
|||||||
}
|
}
|
||||||
final String className_ = className;
|
final String className_ = className;
|
||||||
final Intent intent_ = intent;
|
final Intent intent_ = intent;
|
||||||
Runnable runnable = new Runnable() {
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -676,12 +676,7 @@ public class Context extends Object {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
|
||||||
runnable.run();
|
|
||||||
} else {
|
|
||||||
new Handler(Looper.getMainLooper()).post(runnable);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startActivity(Intent intent, Bundle options) {
|
public void startActivity(Intent intent, Bundle options) {
|
||||||
|
|||||||
Reference in New Issue
Block a user