-2
我想知道,如何從android中的對話框單擊操作中調用片段。該對話框在另一個活動中。如何從android中的對話框中調用片段?
下面是對話框部分代碼
public static void Bookingconfirm(final Context _context, String title,String strMessage)
{
final Dialog dialog1 = new Dialog(_context);
Log.e("Point","1");
dialog1.setContentView(R.layout.booking_success);
dialog1.setCanceledOnTouchOutside(true);
dialog1.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog1.findViewById(R.id.d_location);
LinearLayout btnok = (LinearLayout) dialog1.findViewById(R.id.booking_ok);
btnok.setOnClickListener(new OnClickListener()
{
@SuppressLint("NewApi") @Override
public void onClick(View arg0)
{
Log.e("Point","2");
//i wanted the click to fragment here
// parent class of fragment Home.java and fragment is booking.java
}
});
dialog1.show();
}