Category : android-alertdialog

I have created a custom dialog containing calendar. It works good in API 29+, but in API 21, it appears as below i.e. is appearing only 1/4 Below is the XML: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <TextView ..> <!– For title –> <CalendarView android:id="@+id/dialog_calendar_Calendar" android:layout_width="match_parent" android:layout_height="wrap_content" </CalendarView> </LinearLayout> </FrameLayout> Even after ..

Read more

I try to send an alert message 2 minutes after the user clicked. I try to set the calendar the date but It always sends me right away the alert. I glad for your help! private void notificationDialog() { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); String NOTIFICATION_CHANNEL_ID = "tutorialspoint_01"; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { @SuppressLint("WrongConstant") NotificationChannel ..

Read more

Check the network with isOnline(). if it is not connected, show the dialog to reconnect. if is connected, dismiss the dialog. It doesn’t dismiss dialog when I put dismiss() in else{}, but dismiss then I put it out of else(). any help will be appreciated public class NetworkChangeListener extends BroadcastReceiver { @Override public void onReceive(Context ..

Read more

I have an AlertDialog that I want to display at least once to the user and then continuously display the dialog to the user even after the user clicks "ok" until a certain condition is met. Here’s the code structure I have so far for the AlertDialog: do { val dialogShow: AlertDialog.Builder = AlertDialog.Builder([email protected]) dialogShow.setCancelable(false) ..

Read more

I am trying to add my dynamic list of data into dialog multiple select options and I’m receiving following error: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 Code class PublishActivity : AppCompatActivity() { lateinit var tags: List<Tags> override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_publish) // get api data getDynamicOptions() // get data into dialog pTags.setOnClickListener{ val tagOptions = arrayOfNulls<String>(tags.size) ..

Read more