tags:

views:

39

answers:

1

Hi friends I am passing parameter to new activity using tab host in android but it showing illegal exception

 Intent homeintent;   
    // Create an Intent to launch an Activity for the tab (to be reused) 
    homeintent = new Intent();
     Bundle bundle=getIntent().getExtras();
     String strusername=bundle.get("strUserName").toString();
     String strPassWord=bundle.getString("strPassword").toString();
     String questGroupId=bundle.getString("questGroupId").toString();
     homeintent.putExtra("strUserName", strusername);
     homeintent.putExtra("strPassword",strPassWord );
     homeintent.putExtra("questGroupId",questGroupId);
      homeintent.setClass(this, HomeActivity.class); 
       spec = tabHost.newTabSpec("home").setIndicator("Home",res.getDrawable(R.drawable.home_tab_bar_icon)).setContent(homeintent);
    tabHost.addTab(spec); 

can anybody tell how to pass parameter using intent with tabhost in android

A: 

You are using the right way... Give this a try too.. setClass of Intent before putting Data into it.

success_anil