I am trying to create a simple library for launching an intent.
The below java code gives me an error in b4a after compiling (that context is required). Please assist
The below java code gives me an error in b4a after compiling (that context is required). Please assist
B4X:
import android.content.Context;
import android.content.Intent;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
//Library version
//Applicable only to this class
@ShortName("NextLauncherThreed")
public class NextLauncher {
public static void NextLauncherlaunch(Context context) {
Intent launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage("com.gtp.nextlauncher");
if (launchIntentForPackage == null) {
launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage("com.gtp.nextlauncher.trial");
}
Intent intent = new Intent("com.gau.go.launcherex.MyThemes.mythemeaction");
intent.putExtra("type", 1);
intent.putExtra("pkgname", context.getPackageName());
context.sendBroadcast(intent);
context.startActivity(launchIntentForPackage);
}
}