android pdf

孙翰墨
2023-12-01

Intent intent = new Intent();

  //intent.addCategory("android.intent.category.DEFAULT");

  
  intent.setAction(android.content.Intent.ACTION_VIEW);

  Uri uri = Uri.fromFile(new File(param));

  intent.setDataAndType(uri, "application/pdf");
  
  //Intent intent2 = new Intent(); 
  //intent2.setAction(Intent.ACTION_CHOOSER); 
  //intent2.putExtra(Intent.EXTRA_TITLE, "请选择能够打开pdf的应用"); 
  //intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  //intent2.putExtra(Intent.EXTRA_INTENT, intent); 
  ComponentName componetName = new ComponentName(  
                //这个是另外一个应用程序的包名  
                "com.chaozh.iReaderFree",  
                 //这个是要启动的Activity  
                 "com.chaozh.iReader.ui.activity.WelcomeActivity");  
          intent.setComponent(componetName);  
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         // startActivity(intent);  
         
         System.out.println( android.os.Build.MODEL+"," + android.os.Build.VERSION.SDK + ","+ android.os.Build.VERSION.RELEASE);

 类似资料:

相关阅读

相关文章

相关问答