Android Question Intent from inside Library Help

walterf25

Expert
Licensed User
Longtime User
Hi All, i'm updating a library which was working great before, but the vendors released a new SDK and they are now sending the intents from within the library, i followed this thread here but i am having problems, when i send a command which is supposed to open an Admin Menu, I see in the logs Activity_Pause and Activity_Resume but nothing shows up, i am expecting a different activity pop up which would show the Admin Menu.

On the code below,
Intent:
try {
         ba.startActivityForResult(ion, null); //<-- passing null instead of an intent
      } catch (NullPointerException npe) {
         //required...
      }
      BA.SharedProcessBA sba = ba.sharedProcessBA;
      try {
         Field f = BA.SharedProcessBA.class.getDeclaredField("onActivityResultCode");
         f.setAccessible(true);
         int requestCode = f.getInt(sba) - 1;
         'requestCode holds the value that should be used to send the intent.
      } catch (Exception e) {
         throw new RuntimeException(e);
      }

Where it says requestCode holds the value that should be used to send the intent, what does this mean exactly and how do I use the requestCode?

I am a bit confused on that part, i don't get any errors, except that the
BA.SharedProcessBA sba = ba.sharedProcessBA; part shows that sba is null, but I handled that part by checking first if null and then setting sba = mba.

Any help to get passed this issue would be greatly appreciated.

Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
This code is not relevant for the first step. If the library code sends an intent then another app or activity should start. The next step is to intercept the result.
Is there anything else I should be doing then, when I send the command that is supposed to send the intent to open up the Admin Menu, i don't see anything popping up, I do however see in the logs that the Main Activity pauses then it Resumes, as if something is happening, any advice, is there anything that should be added to the Manifest file?

Walter
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
is there anything that should be added to the Manifest file?
How should we know? You are not providing any information about the library you are wrapping, their documentation or example app.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
How should we know? You are not providing any information about the library you are wrapping, their documentation or example app.
I meant in general, I mean sending an Intent to open another Activity is pretty straight forward, my question is, what could cause the intent not to work, (ie Activity no open).

Walter
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I would start checking their docs, evaluating the example, check if there is anything which is needed in the manifest (the example probably has a special manifest if it is needed).
I would also check the unfiltered log to see if there is any error.

my question is, what could cause the intent not to work, (ie Activity no open)
Sorry, i can´t answer this question.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I would start checking their docs, evaluating the example, check if there is anything which is needed in the manifest (the example probably has a special manifest if it is needed).
I would also check the unfiltered log to see if there is any error.


Sorry, i can´t answer this question.
Thanks, I already went through their example and their documentation and don't see anything, i'll keep trying, i'm sure it must be something simple that i may be missing.

Walter
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Make sure to check the unfiltered logs.
The new Thread is here
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Make sure to check the unfiltered logs.
The unfiltered logs are these:
SDKManager initialized....
mSystemManager=com.pos.device.master.ISystemManager$Stub$Proxy@1b8e6dcd
mSystemManager=com.pos.device.master.ISystemManager$Stub$Proxy@1b8e6dcd
WRITE, CONTENT == package_name=com.hidata.traxidriver2
class_name=com.hidata.traxidriver2.Main
NL MSG, len[4015], NL type[0x1C] WNI type[0x5900] len[38671]
NL MSG, PID: 309
START u0 {act=amobilepayment.MENU_ADMIN typ=text/plain cmp=com.amobilepayment.ctpay/.Transactions.ClientIntentHandlerMenuActivity (has extras)} from uid 10117 on display 0
addAppToken: AppWindowToken{3d8ac16c token=Token{12d01a1f ActivityRecord{22f369be u0 com.amobilepayment.ctpay/.Transactions.ClientIntentHandlerMenuActivity t341}}} to stack=1 task=341 at 1
** Activity (main) Pause, UserClosed = false **
FPS: 22
NL MSG, len[4087], NL type[0x1C] WNI type[0x5900] len[57103]
type=1400 audit(0.0:1191): avc: granted { write } for name="launcher_app_info.txt" dev="mmcblk0p32" ino=73779 scontext=u:r:system_app:s0 tcontext=u:eek:bject_r:system_data_file:s0 tclass=file
NL MSG, PID: 309
Display changed displayId=0
NL MSG, len[914], NL type[0x11] WNI type[0x5050] len[894]
NL MSG, PID: 309
Poll result = 1
Found some events!!!
no_seq_check received
event received NL80211_CMD_NEW_SCAN_RESULTS
event received NL80211_CMD_NEW_SCAN_RESULTS, vendor_id = 0x0
event ignored!!
NL MSG, len[4042], NL type[0x1C] WNI type[0x5900] len[45583]
NL MSG, PID: 309
NL MSG, len[3950], NL type[0x1C] WNI type[0x5900] len[22031]
NL MSG, PID: 309
onActivityCreated ClientIntentHandlerMenuActivity
forcedStatusBarColor E
forcedStatusBarColor
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
Attempt to remove local handle scope entry from IRT, ignoring
** Activity (main) Resume **
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@8b7335 attribute=null, token = android.os.BinderProxy@2eda645e
Timeline: Activity_idle id: android.os.BinderProxy@21174f5f time:169071570
onActivityDestroyed ClientIntentHandlerMenuActivity
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Why are you making duplicate posts?

We cannot really know why the target activity wasn't started. It is not related to the handling of the result.
It seems to me unless I'm interpreting the unfiltered logs wrong, that the target activity is started but it gets destroyed, but not sure why that would be, I do see from time to time a white screen that pops up but goes away really fast.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Do they provide an Android Studio example? If so, try it. Once you get it working it will be easier to understand the differences.
Yes, I already tried running the Android Studio Example and it works fine, which is why I don't understand why it doesn't work from the wrapped Library, everything is the same, I don't see anything different.

Walter
 
Upvote 0
Top