|
|
|
package com.vodeapp.customsIcon;
|
|
|
|
package com.customIcon;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.content.ComponentName;
|
|
...
|
...
|
@@ -9,10 +9,10 @@ import com.facebook.react.bridge.ReactApplicationContext; |
|
|
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
|
|
import com.facebook.react.bridge.ReactMethod;
|
|
|
|
|
|
|
|
public class CustomsIconModule extends ReactContextBaseJavaModule {
|
|
|
|
public class CustomIconModule extends ReactContextBaseJavaModule {
|
|
|
|
private final ReactApplicationContext reactContext;
|
|
|
|
|
|
|
|
public CustomsIconModule(ReactApplicationContext reactContext) {
|
|
|
|
public CustomIconModule(ReactApplicationContext reactContext) {
|
|
|
|
super(reactContext);
|
|
|
|
this.reactContext = reactContext;
|
|
|
|
}
|
|
...
|
...
|
@@ -28,12 +28,13 @@ public class CustomsIconModule extends ReactContextBaseJavaModule { |
|
|
|
PackageManager packageManager = this.reactContext.getPackageManager();
|
|
|
|
Activity activity = getActivity();
|
|
|
|
ComponentName am =activity.getComponentName();
|
|
|
|
packageManager.setComponentEnabledSetting(new ComponentName(this.reactContext, pageName +
|
|
|
|
am.getShortClassName()), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager
|
|
|
|
// if(am.getShortClassName()==""){
|
|
|
|
|
|
|
|
// }
|
|
|
|
packageManager.setComponentEnabledSetting(am, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager
|
|
|
|
.DONT_KILL_APP);
|
|
|
|
packageManager.setComponentEnabledSetting(new ComponentName(this.reactContext,pageName +
|
|
|
|
"."+name), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager
|
|
|
|
.DONT_KILL_APP);
|
|
|
|
"."+name), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0);
|
|
|
|
}
|
|
|
|
public Activity getActivity() {
|
|
|
|
return this.getCurrentActivity();
|
...
|
...
|
|