Android Question Inline Java intents

Rusty

Well-Known Member
Licensed User
Longtime User
in your post: https://www.b4x.com/android/forum/t...ivityforresult-with-javaobject.40374/#content
Shouldn't the below sub be "Sub GetBA as JavaObject"?

B4X:
Sub GetBA As ObjectDim jo AsJavaObject
Dim cls AsString = Me
cls = cls.SubString("class ".Length)
jo.InitializeStatic(cls)Return jo.GetField("processBA")End Sub
Where can I find a list of intents and when do we preface the intent with "android.intent.action.xxxxxxx"?

I used your demo code with the JavaObject and it worked great.
I am having a problem integrating the wigits code:
B4X:
Dim i As Intent
   i.Initialize("android.intent.action.ACTION_APPWIDGET_PICK", "")
   i.PutExtra("android.intent.extra.EXTRA_APPWIDGET_ID", "TSStart")
   StartActivityForResult(i)
into that code. (TSStart is a widget that is installed.)
Can you advise?

Regards,
Rusty
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Shouldn't the below sub be "Sub GetBA as JavaObject"?
It doesn't matter. Both will work.

Most of the intents are listed here: http://developer.android.com/reference/android/content/Intent.html

Google will help you find the relevant class. In this case it is here: http://developer.android.com/reference/android/appwidget/AppWidgetManager.html#ACTION_APPWIDGET_PICK

The action should be: android.appwidget.action.APPWIDGET_PICK

The extra key should be: appWidgetId

Based on the documentation this intent should be used from an AppWidgetHost activity. This is not a standard activity.
 
Upvote 0
Top