I have a very simple app.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.content_main);
Button button = (Button) findViewById(R.id.btn_click);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(MainActivity.this, "clicked", Toast.LENGTH_SHORT).show();
}
});
}catch ( Exception e) {
e.printStackTrace();
}
}
}
Previously it was working fine with jdk 1.8 but after downgrading to jdk 1.6 it just crashes with the exception:
android.content.res.Resources$NotFoundException: Resource ID #0x7f020000
Its probably the id of the layout.
After downgrading my java to jdk 1.6:
I had to rollback compileSdkVerion from 23 to 19
buildToolsVersion from 24.0.0 to 19.1.0
had removed all support libraries
to make things work, Anyone help me figure out why this is happening.
I have seen this but it didn't help me.