Java android show toast
Toast testToast = Toast.makeText(this, "Your Message Here", Toast.LENGTH_LONG); testToast.show();Toast testToast = Toast.makeText(this, "Your Message Here", Toast.LENGTH_LONG); testToast.show();
Toast testToast = Toast.makeText(this, "Your Message Here", Toast.LENGTH_LONG); testToast.show();Toast testToast = Toast.makeText(this, "Your Message Here", Toast.LENGTH_LONG); testToast.show();
@Override public void onBackPressed() { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.setTitle("Do You Want To Exit From Application?"); alertDialogBuilder .setMessage("Click Yes to exit!") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { moveTaskToBack(true); android.os.Process.killProcess(android.os.Process.myPid()); System.exit(1); } }) .setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); … Read more
dependencies { implementation ‘com.github.bumptech.glide:glide:4.11.0’ annotationProcessor ‘com.github.bumptech.glide:compiler:4.11.0’ }dependencies { implementation ‘com.github.bumptech.glide:glide:4.11.0’ annotationProcessor ‘com.github.bumptech.glide:compiler:4.11.0’ }
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); float displayHeight = displayMetrics.heightPixels / displayMetrics.density; float displayWidth = displayMetrics.widthPixels / displayMetrics.density; Log.d("Display Height", displayHeight +""); Log.d("Display Width", displayWidth +"");DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); float displayHeight = displayMetrics.heightPixels / displayMetrics.density; float displayWidth = displayMetrics.widthPixels / displayMetrics.density; Log.d("Display Height", displayHeight +""); Log.d("Display Width", displayWidth +"");
android.useAndroidX=true android.enableJetifier=trueandroid.useAndroidX=true android.enableJetifier=true
android.useAndroidX=true android.enableJetifier=trueandroid.useAndroidX=true android.enableJetifier=true
Bukkit.getServer().broadcastMessage("Write Your message here.");Bukkit.getServer().broadcastMessage("Write Your message here.");
if (recyclerview.getItemCount() == 0) { Toast.makeText(getActivity(), "No records to show!", Toast.LENGTH_SHORT).show(); }if (recyclerview.getItemCount() == 0) { Toast.makeText(getActivity(), "No records to show!", Toast.LENGTH_SHORT).show(); }
Android java set current Calendar c = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String strDate = sdf.format(c.getTime()); Log.d("Date","DATE : " + strDate)Calendar c = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String strDate = sdf.format(c.getTime()); Log.d("Date","DATE : " + strDate) Android java get current import java.time.*; LocalDate date = LocalDate.now();import java.time.*; LocalDate date = … Read more
dependencies { implementation "androidx.recyclerview:recyclerview:1.1.0" // For control over item selection of both touch and mouse driven selection implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc01" }dependencies { implementation "androidx.recyclerview:recyclerview:1.1.0" // For control over item selection of both touch and mouse driven selection implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc01" }