Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用Linkify访问活动时出现异常_Android_Android Intent_Android Activity_Linkify - Fatal编程技术网

Android 使用Linkify访问活动时出现异常

Android 使用Linkify访问活动时出现异常,android,android-intent,android-activity,linkify,Android,Android Intent,Android Activity,Linkify,我在尝试单击textview启动活动时遇到异常。 下面是我用来访问活动的代码 tv1.setText(result+" "); tv1.setEms(5); Pattern pattern = Pattern.compile("[a-zA-Z/a-zA-Z]"); Linkify.addLinks(tv1, pattern,null); tv1.setOnClic

我在尝试单击
textview
启动活动时遇到异常。 下面是我用来访问活动的代码

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);
这是我注册第二个活动的android.manifest文件

 <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>
]

为此,您需要有两个元素。一个 将用于主和发射器。另一个将用于查看, 可浏览/默认,以及您的元素:

应该启动您的活动

--


您正在使用NDK吗?错误似乎来自
JNI
Pattern-Pattern=Pattern.compile(“[a-zA-Z/a-zA-Z]”);//Linkify.addLinks(tv1,pattern,null);我这样做了,错误消失了。。。是否有其他方法。至少有人能说一下如何使用Linkify调用活动。。我是android新手一些帮助您可能需要根据需要更新您的问题,我已经添加了
linkify
标签
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)
Intent ourIntent = new Intent(Http_schedule.this, HttpSecondSchedule.class);                    
       try {
             ourIntent.setAction("com.example.ship_service_list.HttpSecondSchedule");
              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();
        }