Here is my code:
chartDialog = new Dialog(item_activity.this);
chartDialog.setContentView(R.layout.customlayout);
chartDialog.setTitle("Title ");
TextView textItemDetailsDialog = (TextView) chartDialog.findViewById(R.id.textItemDetailsDialog);
textItemDetailsDialog.setText("Details");
img = (ImageView) chartDialog.findViewById(R.id.ImageView001);
img.setImageBitmap(bitmap);
Button toMap = (Button)findViewById(R.id.button_toMap);
toMap.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
switchTabSpecial();
}
});
chartDialog.show();
However, it shows
03-26 23:30:10.822: E/AndroidRuntime(21394): java.lang.NullPointerException
at line:
toMap.setOnClickListener(new View.OnClickListener() {
Can I add a button in Dialog??
Please help…
As the Button is on the Dialog it should be as,