I'm trying to port a new library: StandOut.
[APP][2.1+] StandOut - Create Floating Apps [Updated 7/8: Window Editor] - xda-developers
It seems a lot of people are having trouble with starting activities, services, etc from a library and again, i'm having trouble too. (I don't know if it's related though.)
b4a code
This log happens after clicking the menu:
Java:
Edit after adding the system alert permission, i have the following error:
[APP][2.1+] StandOut - Create Floating Apps [Updated 7/8: Window Editor] - xda-developers
It seems a lot of people are having trouble with starting activities, services, etc from a library and again, i'm having trouble too. (I don't know if it's related though.)
b4a code
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim StandOut As RSStandOut
Dim mbw As RSMostBasicWindow
Dim pnlBasic As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Load activity stuff
Activity.AddMenuItem("Show Basic", "mnuShowBasic")
'Initialize BasicWindow Panel
pnlBasic.Initialize("BasicWindow")
pnlBasic.LoadLayout("BasicWindow.bal")
'Initialize StandOut
StandOut.Initialize("StandOut")
'StandOut.createBasicWindow(pnlBasic)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub mnuShowBasic_Click
StandOut.showBasicWindow
'StartService(Window)
'Activity.Finish
End Sub
This log happens after clicking the menu:
View attached!
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRoot$W@2b009e10 -- permission denied for this window type
at android.view.ViewRoot.setView(ViewRoot.java:570)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at com.rootsoft.standout.StandOutWindow.show(StandOutWindow.java:1440)
at com.rootsoft.standout.StandOutWindow.onStartCommand(StandOutWindow.java:716)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2060)
at android.app.ActivityThread.access$2800(ActivityThread.java:121)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1006)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
Error showing notification for service
java.lang.IllegalArgumentException: contentIntent required: pkg=com.rootsoft.standout id=721247375 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x60)
at com.android.server.NotificationManagerService.enqueueNotificationInternal(NotificationManagerService.java:790)
at com.android.server.am.ServiceRecord$1.run(ServiceRecord.java:342)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1366)
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.IllegalArgumentException: contentIntent required: pkg=com.rootsoft.standout id=721247375 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x60)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1056)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
FATAL EXCEPTION: main
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.IllegalArgumentException: contentIntent required: pkg=com.rootsoft.standout id=721247375 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x60)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1056)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
Force finishing activity com.rootsoft.standout/.main
Activity pause timeout for HistoryRecord{2b5b9720 com.rootsoft.standout/.main}
Java:
B4X:
package com.rootsoft.standout;
import android.graphics.Color;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.TextView;
import anywheresoftware.b4a.BA.ShortName;
@ShortName("RSMostBasicWindow")
public class MostBasicWindow extends StandOutWindow {
@Override
protected String getAppName() {
return "MostBasicWindow";
}
@Override
protected int getAppIcon() {
return android.R.drawable.btn_star;
}
@Override
protected void createAndAttachView(int id, FrameLayout frame) {
Log.i("B4A", "View attached!");
TextView view = new TextView(this);
view.setText("MostBasicWindow");
view.setBackgroundColor(Color.CYAN);
frame.addView(view);
}
@Override
protected LayoutParams getParams(int id, Window window) {
return new LayoutParams(id, 200, 150, 100, 100);
}
}
Edit after adding the system alert permission, i have the following error:
View attached!
Error showing notification for service
java.lang.IllegalArgumentException: contentIntent required: pkg=com.rootsoft.standout id=721391847 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x60)
at com.android.server.NotificationManagerService.enqueueNotificationInternal(NotificationManagerService.java:790)
at com.android.server.am.ServiceRecord$1.run(ServiceRecord.java:342)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1366)
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.IllegalArgumentException: contentIntent required: pkg=com.rootsoft.standout id=721391847 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x60)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1056)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
FATAL EXCEPTION: main
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.IllegalArgumentException: contentIntent required: pkg=com.rootsoft.standout id=721391847 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x60)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1056)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
Force finishing activity com.rootsoft.standout/.main
Activity pause timeout for HistoryRecord{2b50e720 com.rootsoft.standout/.main}
Aggregate from 1345400923447 (log), 1345400923447 (data)
Activity destroy timeout for HistoryRecord{2b50e720 com.rootsoft.standout/.main}
Last edited: