0
    Uri uri = Uri.parse("com.dynamixsoftware.printershare.print");
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(uri);
    intent.setPackage("com.dynamixsoftware.printershare.print");
    intent.setType("application/pdf");
    startActivity(intent);
    return true;

This is the code I am using to call another application from my application. I think the uri I am mentioning is incorrect. In that case, I dont know how to get the right one. Else, I don't know what's going wrong. I have no error in the logcat and the application force closes.

Usama Sarwar
  • 8,922
  • 7
  • 54
  • 80
Khush
  • 867
  • 1
  • 19
  • 46
  • The answer here may help you find a solution, http://stackoverflow.com/questions/2923265/android-how-do-i-open-another-app-from-my-app :) – Phil Kearney Jan 10 '12 at 12:28

1 Answers1

0

Try it,

Intent intent =  getPackageManager()                    
.getLaunchIntentForPackage("com.dynamixsoftware.printershare.print");
startActivity(intent);
Nikhil C George
  • 1,207
  • 1
  • 10
  • 14
  • 01-11 08:55:28.452: E/AndroidRuntime(341): java.lang.NullPointerException – Khush Jan 11 '12 at 03:27
  • 01-11 08:55:28.452: E/AndroidRuntime(341): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.app.Activity.startActivityForResult(Activity.java:2827) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.app.Activity.startActivity(Activity.java:2933) 01-11 08:55:28.452: E/AndroidRuntime(341): at com.imagemanip.MainActivity.queuePictureStreamForPrinting(MainActivity.java:164) 01-11 08:55:28.452: E/AndroidRuntime(341): at com.imagemanip.MainActivity.saveCanvasPictureToTempFile(MainActivity.java:122) – Khush Jan 11 '12 at 03:28
  • 01-11 08:55:28.452: E/AndroidRuntime(341): at com.imagemanip.MainActivity$1.onClick(MainActivity.java:63) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.view.View.performClick(View.java:2485) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.view.View$PerformClick.run(View.java:9080) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.os.Handler.handleCallback(Handler.java:587) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.os.Handler.dispatchMessage(Handler.java:92) 01-11 08:55:28.452: E/AndroidRuntime(341): at android.os.Looper.loop(Looper.java:123) – Khush Jan 11 '12 at 03:28