hello,
i try to have the name of a service with reflector...
it's return a error
the android source :
WallpaperInfo | Android Developers
here the solution in java
Thx for help
i try to have the name of a service with reflector...
B4X:
Dim r As Reflector
Dim sServiceName As String
r.Target = r.RunStaticMethod("android.app.getWallpaperInfo", "getInstance", Array As Object(r.GetContext), Array As String("android.content.Context"))
sServiceName = r.RunMethod("getServiceName")
Msgbox(sServiceName,"")
it's return a error
the android source :
WallpaperInfo | Android Developers
here the solution in java
B4X:
WallpaperManager wpm = (WallpaperManager) getSystemService(WALLPAPER_SERVICE);
WallpaperInfo info = wpm.getWallpaperInfo();
if (info != null && info.getComponent().equals(new ComponentName(this, getClass()))) {
Log.d(TAG, "We're already running");
// Still might be a preview, but the user is already running your LWP.
} else {
Log.d(TAG, "We're not running, this should be a preview");
// Should definitely be a preview.
}
Thx for help
Last edited: