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
add Java APIs needed for WhatsApp MainActivity and ConversationActivity
This commit is contained in:
@@ -418,6 +418,7 @@ public class Context extends Object {
|
||||
Class<? extends Service> cls = Class.forName(component.getClassName()).asSubclass(Service.class);
|
||||
if (!runningServices.containsKey(cls)) {
|
||||
Service service = cls.getConstructor().newInstance();
|
||||
service.attachBaseContext(new Context());
|
||||
service.onCreate();
|
||||
runningServices.put(cls, service);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.os.Parcelable;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Intent {
|
||||
public class Intent implements Parcelable {
|
||||
private ComponentName component;
|
||||
private Bundle extras = new Bundle();
|
||||
private String action;
|
||||
@@ -316,13 +316,26 @@ public class Intent {
|
||||
}
|
||||
|
||||
public String getPackage() {
|
||||
return component.getPackageName();
|
||||
return component == null ? null : component.getPackageName();
|
||||
}
|
||||
|
||||
public String getScheme() {
|
||||
return data == null ? null : data.getScheme();
|
||||
}
|
||||
|
||||
public Intent putStringArrayListExtra(String name, ArrayList<String> value) {
|
||||
extras.putStringArrayList(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayList<String> getStringArrayListExtra(String name) {
|
||||
return extras.getStringArrayList(name);
|
||||
}
|
||||
|
||||
public ClipData getClipData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class ShortcutIconResource {
|
||||
|
||||
public static ShortcutIconResource fromContext(Context context, int id) {
|
||||
|
||||
Reference in New Issue
Block a user