tags:

views:

106

answers:

1

Hello Developers

Thanks to every on to support android development forum. I want to make a application where when I click a button in my application then open android built-in Calculator application.

That means I want to call calculator apk file from my application. Is it possible?

Advanced thanks to reply

A: 

Hi I have find out the following step:

  1. Create an intent with action=MAIN and category=LAUNCHER
  2. Get the PackageManager from the current context using context.getPackageManager
  3. packageManager.queryIntentActivity(, 0) where intent has category=LAUNCHER, action=MAIN or packageManager.resolveActivity(, 0) to get the first activity with main/launcher
  4. Get the ActivityInfo you're interested in
  5. From the ActivityInfo, get the packageName and name
  6. Finally, create another intent with with category=LAUNCHER, action=MAIN, componentName = new ComponentName(packageName, name) and setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
  7. Finally, context.startActivity(newIntent)

But I am confused about the packageName and className of buit-in calculator application.Would u known about those information pls reply me ASAP.

Thanks to all

Jobayer