我更新了我的问题,因为有些误解。
所以,我有一个通知。当我点击那个通知时,我希望文件浏览器应用程序(当然是第三方应用程序)打开。无论是哪个应用程序,如果有多个文件浏览器,则应提示“使用以下应用程序打开”-然后打开/sdcard/folder(如果可能)
我的通知在Listar.class中。
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.ic_menu_save, msg, System.currentTimeMillis());
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, Open.class), 0);
notification.setLatestEventInfo(this, filename+" downloaded", "Click to open folder", contentIntent);
manager.notify(1, notification);
我的开放类在这里:
public class Open extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try{
Intent intent = new Intent("org.openintents.action.PICK_FILE");
startActivityForResult(intent, 1);
}
catch(Exception e)
{
Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
Log.v("EX",e.toString());
}
}
}
这会打开oi文件管理器(没有“打开方式” - 我没有选择默认应用程序),并进入/sdcard目录,所以我需要您的帮助。