1. Is it possible to tell me which problems?
2. Also passing the ba instance in a public method, I don't know how I would achieve this with the StandOut library.
I have 2 classes:
StandOutDemo and MostBasicWindow
In StandOutDemo, i call this:
/**
* Shows the most Basic Window.
*/
public void showBasicWindow() {
StandOutWindow.show(ba.context, MostBasicWindow.class, StandOutWindow.DEFAULT_ID);
}
This code will call the MostBasicWindow. I cannot pass a MostBasicWindow instance to it, it's the class, so i'm unable to call an Initialize method. Perhaps there's a way i can grab the window that was started.
3. Could you please read the topic i started here.
android - Solve NotSerializableException - Stack Overflow
As for getting rid of your exception, you just have to implement the Serializable interface in your class in question (in your case anywheresoftware.b4a.BALayout).
This means that I need an update in B4AShared.jar in BALayout.
I'm wondering if you could send me an updated version of it.
Thanks
Tomas
EDIT: INFORMATION FOR TDS
Methods:
- isSet (flags As Int, flag As Int) As Boolean
Properties:
- DirDefaultExternal As String
Methods:
- getResourceId (pResourceName As String, pResourceType As String) As Int
- RSEditor
Properties:
- Editor As Editor
Gets or sets the editor.
Methods:
- Initialize ()
Initializes the Editor
EventName - Events subs prefix.
Convenient way to resize or reposition a Window. The Editor allows you to easily resize and reposition the window around anchor points.
- commit
Commit the changes to this window. Updates the layout.
This Editor cannot be used after you commit.
- setAnchorPoint (x As Float, y As Float)
Sets the AnchorPoint
- setPosition (x As Int, y As Int)
Set the position of this window in absolute pixels
- setSize (width As Int, height As Int)
Set the size of this window in absolute pixels.
- RSFlags
- RSMostBasicWindow
Properties:
- Application As Application
- ApplicationContext As Context
- ApplicationInfo As ApplicationInfo
- Assets As AssetManager
- BaseContext As Context
- CacheDir As File
- ClassLoader As ClassLoader
- ContentResolver As ContentResolver
- ExternalCacheDir As File
- FilesDir As File
- MainLooper As Looper
- ObbDir As File
- PackageCodePath As String
- PackageManager As PackageManager
- PackageName As String
- PackageResourcePath As String
- Resources As Resources
- Theme As Theme
- Wallpaper As Drawable
- WallpaperDesiredMinimumHeight As Int
- WallpaperDesiredMinimumWidth As Int
Methods:
- bindService (arg0 As Intent, arg1 As ServiceConnection, arg2 As Int) As Boolean
- checkCallingOrSelfPermission (arg0 As String) As Int
- checkCallingOrSelfUriPermission (arg0 As Uri, arg1 As Int) As Int
- checkCallingPermission (arg0 As String) As Int
- checkCallingUriPermission (arg0 As Uri, arg1 As Int) As Int
- checkPermission (arg0 As String, arg1 As Int, arg2 As Int) As Int
- checkUriPermission (arg0 As Uri, arg1 As Int, arg2 As Int, arg3 As Int) As Int
- clearWallpaper
- close (context As Context, cls As Class, id As Int)
Close an existing window with an existing id.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that is managing
the window.
id: The id representing this window. The window must previously be
shown.
- closeAll (context As Context, cls As Class)
Close all existing windows.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that is managing
the window.
- createPackageContext (arg0 As String, arg1 As Int) As Context
- databaseList As String()
- deleteDatabase (arg0 As String) As Boolean
- deleteFile (arg0 As String) As Boolean
- enforceCallingOrSelfPermission (arg0 As String, arg1 As String)
- enforceCallingOrSelfUriPermission (arg0 As Uri, arg1 As Int, arg2 As String)
- enforceCallingPermission (arg0 As String, arg1 As String)
- enforceCallingUriPermission (arg0 As Uri, arg1 As Int, arg2 As String)
- enforcePermission (arg0 As String, arg1 As Int, arg2 As Int, arg3 As String)
- enforceUriPermission (arg0 As Uri, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As String)
- fileList As String()
- getCloseAllIntent (context As Context, cls As Class) As Intent
See {@link #closeAll(Context, Class, int)}.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that is managing
the window.
Return type: @return:An {@link Intent} to use with
{@link Context#startService(Intent)}.
- getCloseIntent (context As Context, cls As Class, id As Int) As Intent
See {@link #close(Context, Class, int)}.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that is managing
the window.
id: The id representing this window. If the id exists, and the
corresponding window was previously hidden, then that window
will be restored.
Return type: @return:An {@link Intent} to use with
{@link Context#startService(Intent)}.
- getDatabasePath (arg0 As String) As File
- getDir (arg0 As String, arg1 As Int) As File
- getExternalFilesDir (arg0 As String) As File
- getFileStreamPath (arg0 As String) As File
- getHideIntent (context As Context, cls As Class, id As Int) As Intent
See {@link #hide(Context, Class, int)}.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that is managing
the window.
id: The id representing this window. If the id exists, and the
corresponding window was previously hidden, then that window
will be restored.
Return type: @return:An {@link Intent} to use with
{@link Context#startService(Intent)}.
- getSendDataIntent (context As Context, toCls As Class, toId As Int, requestCode As Int, data As Bundle, fromCls As Class, fromId As Int) As Intent
See {@link #sendData(Context, Class, int, int, Bundle, Class, int)}.
context: A Context of the application package implementing the class of
the sending window.
toCls: The Service's class extending {@link StandOutWindow} that is
managing the receiving window.
toId: The id of the receiving window.
requestCode: Provide a request code to declare what kind of data is being
sent.
data: A bundle of parceleable data to be sent to the receiving
window.
fromCls: If the sending window wants a result, provide the class of the
sending window.
fromId: If the sending window wants a result, provide the id of the
sending window.
Return type: @return:An {@link Intnet} to use with
{@link Context#startService(Intent)}.
- getSharedPreferences (arg0 As String, arg1 As Int) As SharedPreferences
- getShowIntent (context As Context, cls As Class, id As Int) As Intent
See {@link #show(Context, Class, int)}.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that will be used
to create and manage the window.
id: The id representing this window. If the id exists, and the
corresponding window was previously hidden, then that window
will be restored.
Return type: @return:An {@link Intent} to use with
{@link Context#startService(Intent)}.
- getStandOutWindow (id As Int, cls As Class) As Window
Returns the StandOut Window with the given id.
id:
Return type: @return:
- getString (arg0 As Int) As String
- getSystemService (arg0 As String) As Object
- getText (arg0 As Int) As CharSequence
- grantUriPermission (arg0 As String, arg1 As Uri, arg2 As Int)
- hide (context As Context, cls As Class, id As Int)
Hide the existing window corresponding to the id. To enable the ability
to restore this window, make sure you implement
{@link #getHiddenNotification(int)}.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that is managing
the window.
id: The id representing this window. The window must previously be
shown.
- isRestricted As Boolean
- obtainStyledAttributes (arg0 As Int()) As TypedArray
- onBind (intent As Intent) As IBinder
- onConfigurationChanged (arg0 As Configuration)
- onCreate
- onDestroy
- onLowMemory
- onRebind (arg0 As Intent)
- onStart (arg0 As Intent, arg1 As Int)
- onStartCommand (intent As Intent, flags As Int, startId As Int) As Int
- onTaskRemoved (arg0 As Intent)
- onTrimMemory (arg0 As Int)
- onUnbind (arg0 As Intent) As Boolean
- openFileInput (arg0 As String) As FileInputStream
- openFileOutput (arg0 As String, arg1 As Int) As FileOutputStream
- openOrCreateDatabase (arg0 As String, arg1 As Int, arg2 As CursorFactory) As SQLiteDatabase
- peekWallpaper As Drawable
- registerComponentCallbacks (arg0 As ComponentCallbacks)
- registerReceiver (arg0 As BroadcastReceiver, arg1 As IntentFilter) As Intent
- removeStickyBroadcast (arg0 As Intent)
- revokeUriPermission (arg0 As Uri, arg1 As Int)
- sendBroadcast (arg0 As Intent)
- sendData (context As Context, toCls As Class, toId As Int, requestCode As Int, data As Bundle, fromCls As Class, fromId As Int)
This allows windows of different applications to communicate with each
other.
<p>
Send {@link Parceleable} data in a {@link Bundle} to a new or existing
windows. The implementation of the recipient window can handle what to do
with the data. To receive a result, provide the class and id of the
sender.
context: A Context of the application package implementing the class of
the sending window.
toCls: The Service's class extending {@link StandOutWindow} that is
managing the receiving window.
toId: The id of the receiving window, or DISREGARD_ID.
requestCode: Provide a request code to declare what kind of data is being
sent.
data: A bundle of parceleable data to be sent to the receiving
window.
fromCls: Provide the class of the sending window if you want a result.
fromId: Provide the id of the sending window if you want a result.
- sendOrderedBroadcast (arg0 As Intent, arg1 As String)
- sendStickyBroadcast (arg0 As Intent)
- sendStickyOrderedBroadcast (arg0 As Intent, arg1 As BroadcastReceiver, arg2 As Handler, arg3 As Int, arg4 As String, arg5 As Bundle)
- show (context As Context, cls As Class, id As Int)
Show a new window corresponding to the id, or restore a previously hidden
window.
context: A Context of the application package implementing this class.
cls: The Service extending {@link StandOutWindow} that will be used
to create and manage the window.
id: The id representing this window. If the id exists, and the
corresponding window was previously hidden, then that window
will be restored.
- startActivities (arg0 As Intent())
- startActivity (arg0 As Intent)
- startForeground (arg0 As Int, arg1 As Notification)
- startInstrumentation (arg0 As ComponentName, arg1 As String, arg2 As Bundle) As Boolean
- startIntentSender (arg0 As IntentSender, arg1 As Intent, arg2 As Int, arg3 As Int, arg4 As Int)
- startService (arg0 As Intent) As ComponentName
- stopForeground (arg0 As Boolean)
- stopSelf
- stopSelfResult (arg0 As Int) As Boolean
- stopService (arg0 As Intent) As Boolean
- unbindService (arg0 As ServiceConnection)
- unregisterComponentCallbacks (arg0 As ComponentCallbacks)
- unregisterReceiver (arg0 As BroadcastReceiver)
- RSStandOut
Permissions:
- android.permission.READ_PHONE_STATE
- android.permission.WRITE_EXTERNAL_STORAGE
- android.permission.WRITE_SECURE_SETTINGS
- android.permission.SYSTEM_ALERT_WINDOW
Methods:
- HideWindow (id As Int)
Hides this window with the given id.
id:
- Initialize ()
Initializes the StandOut library.
EventName - Events subs prefix.
- ReadObjectFromMemory (Dir As String, filename As String) As Object
Reads an object from a specific file.
Dir:
filename:
Return type: @return:
- WindowParams (id As Int, AppName As String, Left As Integer, Top As Int, Width As Int, Height As Int) As Boolean
Sets the window parameters of the window.
Left:
Top:
Width:
Height:
Return type: @return:
- WriteObjectToMemory (Dir As String, filename As String, object As Object) As Boolean
Writes and object to the specific file.
Dir:
filename:
object:
- closeWindow (id As Int)
Closes the window with the given id.
- closeWindowAll
Closes all windows.
- getStandOutWindow (id As Int) As Window
Get the standout window with the given id.
id:
Return type: @return:
- setFlags (id As Int, map As Map) As Boolean
Sets the flags for the given window.
- setNotificationInfo (id As Int, AppIcon As Int, PersistentTitle As String, PersistentMessage As String, HiddenTitle As String, HiddenMessage As String) As Boolean
Set the titles and messages for the notifications.
- showWindow (id As Int)
Shows the window with the given id.
- RSWindow
Properties:
- Background As Drawable
Gets or sets the background.
- Clickable As Boolean
Gets or sets the view to be clickable.
- Color As
Sets the background color.
- Enabled As Boolean
Gets or sets the window enabled.
- FrameLayout As FrameLayout
Gets the framelayout.
- Height As Int
Gets the height of the window.
- Left As Int
Gets the window's left.
- MinimumHeight As
Sets the window's minimum height.
- MinimumWidth As
Sets the window's minimum width.
- NumberOfViews As Int
Gets the number of views.
- Tag As Object
Gets or sets a tag to the window.
- Top As Int
Gets the window's top.
- UniqueID As Int
Returns an unique id.
- Visible As
Gets or sets the window visibility.
- Width As Int
Gets the width of the window.
- Window As Window
Gets or sets the window.
Methods:
- AddView (child As View, left As Int, top As Int, width As Int, height As Int)
Adds a view to the window.
- BringToFront
Brings the window to the front.
- Edit As Editor
Edits the position of the window.
Return type: @return:
- GetView (index As Int) As View
Gets a view by it's id.
- Initialize (EventName As String)
Initializes the Window.
EventName - Events subs prefix.
- Invalidate
Invalidates the view forcing to redraw itself.
- RemoveAllViews
Removes all the views
- RemoveView
Removes the view.
You should not call this.
- RemoveViewAt (index As Int)
Removes the view at the given position.
- RequestFocus As Boolean
Request the window to be focused.
- isFocusable As Boolean
Is the window focusable?
- isFocused As Boolean
Is the window focused?