I've never worked with dialogs before. What I currently have is json data loading in to a new activity from a RecyclerView list. I've managed to get the dialog to load on click, but without the data. Im not sure how to go about changing my Intent to load the new activity to loading the data in to the dialog.
My Previous onClick with the Intent.
public void onClick(View view) {
//Toast.makeText(context, "Clicked", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(context,DetailActivity.class);
intent.putExtra("url",dataMembers.posturl);
RestActivity.tContent = dataMembers.posturl;
context.startActivity(intent);
}
This is with the dialog, it opens but its blank. I'm not sure where or how I would add my Intent to get the data in to the dialog.
public void onClick(View view) {
//Toast.makeText(context, "Clicked", Toast.LENGTH_SHORT).show();
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
int DeviceTotalWidth = metrics.widthPixels;
int DeviceTotalHeight = metrics.heightPixels;
final Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.activity_detail);
dialog.getWindow().setLayout(DeviceTotalWidth ,DeviceTotalHeight);
dialog.show();
Intent intent = new Intent(context,DetailActivity.class);
intent.putExtra("url",dataMembers.posturl);
RestActivity.tContent = dataMembers.posturl;
context.startActivity(intent);
}