I am using DrawerLayout
which has Listview
When I click on the Listview
item , it does not responds to the click ( not launching another activity )
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//requestWindowFeature(Window.FEATURE_NO_TITLE);
final ActionBar actionBar=getActionBar();
actionBar.setIcon(null);
actionBar.setTitle("");
setContentView(R.layout.main_activity);
// Custom ActionBar initializations.
getActionBar().setCustomView(R.layout.action_bar_custom);
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_HOME_AS_UP);
getActionBar().setDisplayUseLogoEnabled(true);
getActionBar().setDisplayShowHomeEnabled(true);
getActionBar().setDisplayShowCustomEnabled(true);
//getActionBar().setIcon(R.drawable.ic_drawer);
// Remember me.
sharedPref=getSharedPreferences("myPref", MODE_PRIVATE);
editor=sharedPref.edit();
//Listview
mDrwawerList=(ListView)findViewById(R.id.list_slidermenu);
listDataHeader = new ArrayList<HashMap<String,String>>();
listDataHeader_temp = new ArrayList<String>();
navigational_adapter=new NavigationListAdapter(MainActivity.this, new ArrayList<HashMap<String,String>>());
mDrawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
mDrawerToggle=new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.nav_btn,0, 0){
public void onDrawerClosed(View drawerView){
getActionBar().setTitle(mTitle);
invalidateOptionsMenu();
}
public void onDrawerOpened(View drawerView) {
getActionBar().setTitle(mDrawerTitle);
invalidateOptionsMenu();
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrwawerList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
TextView txtCategoryName=(TextView)view.findViewById(R.id.txt_category);
String category_name=txtCategoryName.getText().toString();
Log.e("category_name", "karjeevcategory_name "+category_name);
if (category_name.equals("Home")) {
}
else if (category_name.equals("Diamond of the Week")) {
}
else if (category_name.equals("About Us")) {
}
else if (category_name.equals("FAQ")) {
Intent intent=new Intent(MainActivity.this,FAQActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
else if (category_name.equals("Press & Download")) {
}
else if (category_name.equals("Contact Us")) {
}
}
});
new PerformGetCategory().execute();
}