As I am new to Android development, struggling with a problem. I am testing in Android 4.1.2 its working fine, but when I load it to Android 2.3.3 after that when i click a button, it should start an new activity, but its stops and crashes? what can be problem? the mind_sdk is equals to 9,
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.starter);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.starter, menu);
return true;
}
public void openS(View view){
Intent intent = new Intent(this,LoginSU.class );
startActivity(intent);
}
public void openG(View view){
Intent intent = new Intent(this, LoginGE.class);
startActivity(intent);
}
}
When person clicks button, it will fire an action openS or openG, after that it will start an new Activity. Its working in Android 4.1.2 but fails in 2.3.3? hwat can be the cause?
Log Cat
11-14 10:11:26.817: I/dalvikvm(910): Could not find method kz.bimash.food.security.LoginSU.getActionBar, referenced from method kz.bimash.food.security.LoginSU.onCreate
Actually I am not using but its requesting an actionbar.
Can you post your
AndroidManifest.xmlXML and yourres/values/style.xml? I wonder if the app theme is for aHOLOtheme which is unsupported on 2.3.3 and below and trying to open the app withHOLO. It’s a theme which uses the action bar. Or it could be your activity in the manifest is to use aHOLOtheme.Instead make a folder in
res/calledvalues-v11/and make a newstyle.xml. You can copy it from thevalues/. Open the copied file up and check theAppThemestyle. Is the parentandroid:Theme.HOLOorandroid:Theme.HOLO.Lightor something similar? Does it look like this?Having separate
values/andvalues-v11/folders tells the app what theme to do depending on which version is running. Honeycomb 3.0 (v11) and higher would look at thevalues-v11folder for styles and other values, whilst Gingerbread 2.3.4 (v10) and lower would look at thevalues/folder.Now edit the
values/style.xmland make the parentandroid:Theme.Lightorandroid:ThemeCheck out http://developer.android.com/guide/topics/ui/themes.html#SelectATheme for more details about how to use multiple themes in the same app.