[英]calling another project class from another android?
我想調用另一個項目的類。 我在構建路徑中添加了它,還在清單文件中聲明了該類,但是當我調用它時, no class found
錯誤。 我是故意說的。
Intent intent = new Intent(getApplicationContext(), org.coolreader.CoolReader.class);
intent.putExtra("path", adapter.getItem(position).getPath());
startActivity(intent);
如果您想從程序中啟動CoolReader
,而不是查看以下答案 :
Intent coolReaderIntent = getPackageManager().getLaunchIntentForPackage("org.coolreader.CoolReader");
coolReaderIntent.putExtra("path", adapter.getItem(position).getPath());
startActivity(coolReaderIntent);
當然,應該在設備上安裝CoolReader
(程序)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.