2017년 6월 13일 화요일

Input parameter


I have a java application like this :

case TelephonyManager.CALL_STATE_RINGING:
   // CALL_STATE_RINGING
   Toast.makeText(getApplicationContext(), incomingNumber,
         Toast.LENGTH_LONG).show();
   Toast.makeText(getApplicationContext(), "CALL_STATE_RINGING",
         Toast.LENGTH_LONG).show();
   System.out.println("IncomingNumber :" + incomingNumber);
   Intent intent = new Intent();
   Intent launchIntent = getPackageManager().getLaunchIntentForPackage("appinventor.ai_bernard_pre.IncommingCall");
   intent.setData(Uri.parse(incomingNumber));
   startActivity(intent);
   startActivity(launchIntent);

And I try to get input parameter (incomingNumber) in my application, using "GetStartValue" when Screen1 Initialize but I don't receive this parameter.

Thanks for your help.

--

To pass a startup text value to the App Inventor app you are starting with the Activity Starter, ise EXTRAS to set the KEY property to the string APP_INVENTOR_START and set the VALUE Property to the text you want to pass.  The other app can then retrieve this value with Get Start Plain Text.

-- 
Thanks for your help, all is working fine

In my java code :

private static final String ARGUMENT_NAME = "APP_INVENTOR_START";
.
.
.
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("appinventor.ai_bernard_pre.IncommingCall");launchIntent.putExtra(ARGUMENT_NAME, incomingNumber);
startActivity(launchIntent);

And in App inventor I use get plain text

Thanks for all !

-- 

댓글 없음:

댓글 쓰기