Reputation: 41
so I'm trying to start another activity by using this:
public void onClick(View v) {
// TODO Auto-generated method stub
Intent openMap = new Intent("com.highapps.bicineta.MAPVIAS");
startActivity(openMap);
}
});
my android manifest looks like this:
<activity
android:name=".MapVias"
android:label="@string/app_name"
android:exported="false" >
<intent-filter>
<action android:name="com.highapps.bicineta.MAPVIAS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
and im getting this error: "No activity to handle intent"
the funny thing is that i have the same code block to start another activity and it works just fine.. What am I doing wrong?
Upvotes: 0
Views: 178
Reputation: 15809
Some quick checks
Try to implement this way.
AndroidManifest.xml
<activity android:name="com.highapps.bicineta.MapVias"></activity>
OnClick()
public void onClick(View v) {
Intent openMap=new Intent(currentActivity.this,MapVias.class);
startActivity(openMap);
}
});
Upvotes: 0
Reputation: 72673
Just do this:
Intent i = new Intent(CurrentActivity.this, MapVias.class);
startActivity(i);
Replace CurrentActivity
with your current Activity(well, this is obvious :D )
Upvotes: 0
Reputation: 592
Try using
Intent openMap = new Intent("com.highapps.bicineta.MapVias");
since MapVias is the name of your Activity.
According the the Android developer site: "The name of the component that should handle the intent. This field is a ComponentName object — a combination of the fully qualified class name of the target component (for example "com.example.project.app.FreneticActivity") and the package name set in the manifest file of the application where the component resides (for example, "com.example.project")."
Upvotes: 0
Reputation: 6159
Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
CurrentActivity.this.startActivity(myIntent);
Upvotes: 2