public class Database extends Activity {
private TextView tvInfo = (TextView)findViewById(R.id.tvInfo);
private Button btnInfo = (Button)findViewById(R.id.btnInfo);
Hello guys, probably this is just an newbie error in java, but why is this throwing me a NPE? I’m just declaring those variables and it gives me an NPE.
you need to code like below
Try above scenario, you will not get
NullPointerException.