Android Intent Declaration troubles -


i trying go 1 activity sub-activity (i.e, new page more buttons), every time click button, application "unfortunately stops running".

i believe flaw lies in manifest might writing wrong under intent-filter section.

mind taking look?

public class mainactivity extends actionbaractivity {

        button button;          @override         protected void oncreate(bundle savedinstancestate) {             super.oncreate(savedinstancestate);             setcontentview(r.layout.activity_main);              addlisteneronbutton();             addlisteneronbutton2();         }          //first activity                     private void addlisteneronbutton() {             // todo auto-generated method stub             button = (button) findviewbyid(r.id.activity_one);              button.setonclicklistener(new view.onclicklistener() {                  @override                 public void onclick(view arg0) {                    intent intentone =                                  new intent(arg0.getcontext(), activityone.class);                     arg0.getcontext().startactivity(intentone);                  }              });          }               //second activity, later. making explicit now.      public void addlisteneronbutton2() {         button = (button)findviewbyid(r.id.activity_two);          button.setonclicklistener(new view.onclicklistener() {              @override             public void onclick(view argo) {                 intent intenttwo = new intent(intent.action_view, uri.parse("http://google.ca"));                 startactivity(intenttwo);             }         });     }     } 

///////////////////////////////////////////////////////

here manifest :

            <?xml version="1.0" encoding="utf-8"?>     <manifest xmlns:android="http://schemas.android.com/apk/res/android"         package="com.example.poop"         android:versioncode="1"         android:versionname="1.0" >          <uses-sdk             android:minsdkversion="8"             android:targetsdkversion="19" />          <application             android:allowbackup="true"             android:icon="@drawable/ic_launcher"             android:label="@string/app_name"             android:theme="@style/apptheme" >             <activity                 android:name="com.example.poop.mainactivity"                 android:label="@string/app_name" >                 <intent-filter>                     <action android:name="android.intent.action.main" />                      <category android:name="android.intent.category.launcher" />                 </intent-filter>             </activity>              <activity                 android:name="com.example.poop.activityone"                 android:label="@string/app_name" >                 <intent-filter>                     <action android:name="com.example.poop.activityone" />                     <category android:name="android.intent.category.default" />                 </intent-filter>             </activity>          </application>      </manifest> 

i have not added activitytwo yet manifest.

you can't have activities aren't registered in manifest. don't see activityone registered in androidmanifest.xml


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -