我在嘗試通過單擊textview
時啓動活動時收到異常。 這裏是我的代碼用於訪問活動使用Linkify訪問活動時出現異常
tv1.setText(result+" ");
tv1.setEms(5);
Pattern pattern = Pattern.compile("[a-zA-Z/a-zA-Z]");
Linkify.addLinks(tv1, pattern,null);
tv1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent ourIntent = new Intent(Http_schedule.this, HttpSecondSchedule.class);
try {
ourIntent.putExtra("Voyage", (String)jo.get("Voyage"));
ourIntent.putExtra("Ship", jo.get("Ship").toString());
startActivity(ourIntent);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
tbrow2.addView(tv1);
這裏是我註冊了我的第二個活動
<activity
android:name=".HttpSecondSchedule"
android:label="Seat Availability"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"
>
<intent-filter>
<action android:name="com.example.ship_service_list.HttpSecondSchedule" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
這裏android.manifest文件被錯誤我得到
12-05 08:16:38.600: E/InputEventReceiver(1458): Exception dispatching input event.
12-05 08:16:38.600: E/MessageQueue-JNI(1458): Exception in MessageQueue callback: handleReceiveCallback
12-05 08:16:38.770: E/MessageQueue-JNI(1458): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=v (has extras) }
12-05 08:16:38.770: E/MessageQueue-JNI(1458): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
12-05 08:16:38.770: E/MessageQueue-JNI(1458): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
]
您使用'NDK'?錯誤似乎來自'JNI' – 2014-12-05 13:37:22
我沒有使用ndk – 2014-12-06 05:50:04
Pattern pattern = Pattern.compile(「[a-zA-Z/a-zA-Z]」); \t \t \t \t \t //Linkify.addLinks(tv1,pattern,null);我這樣做了,錯誤消失了......是否有任何替代方案。 – 2014-12-06 06:08:59