I'm trying to switch to another activity which holds tabs (Map Activity Main -> Tab Activity and backwards) like this
findViewById(R.id.favButton).setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent i = new Intent(Map.this, Tabs.class);
Map.this.startActivityForResult(i, 0);
}});
and in Tab.class
i have this just to see the layout
public class Tabs extends TabActivity{
public Tabs(Context cont) {
// TODO Auto-generated constructor stub
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanc开发者_C百科eState);
setContentView(R.layout.infotab);
Also here is my segment manifest for the activity
<activity android:name=".Tabs"
android:label="@string/app_name">
</activity>
but I get http://pastebin.com/48Dkn7wu these errors
Please tell me what I'm doing wrong here? I tried starting the activity without results, tried finishing the current one, but nothing helped.
My first guess is that you should remove this constructor:
public Tabs(Context cont) {
// TODO Auto-generated constructor stub
}
or at least put super(cont); in it.
Another possibility is that you didn't follow the instructions to implement a tabbed activity. I see no tabhost or anything in your paste. Are you able to make your tabs work on their own?
Intent intent = new Intent();
intent.setClass(AndroidGPSTrackingActivity.this, mapslayout.class);
startActivity(intent);
<uses-library
android:name="com.google.android.maps"
android:required="true" />**
精彩评论