How to clear or hide an ImageView in Android
// solution 1
ImageView imageView = (ImageView)findViewById(R.id.myimage);
imageView.setImageDrawable(null);
// or
imageView.setImageResource(0);
// solution 2 hide ImageView
imageView.setVisibility(View.INVISIBLE);
// solution 3 resize ImageView 0, 0
hImageViewSemafor.setLayoutParams(new LinearLayout.LayoutParams(0,0));
396LW NO topic_id
AD
Další témata ....(Topics)
private void dialogModeFC() {
try {
final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this)
.setTitle(R.string.select_dialog)
//.setItems(
.setSingleChoiceItems(R.array.select_dialog_items, -1
, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
/* User clicked so do some stuff
<item>Happy New Year</item>
<item>Merry Christmas</item>
<item>I Love You</item>
*/
String[] items = getResources().getStringArray(R.array.select_dialog_items);
// list with boolean variables - which is true
// for (int i = 0; i < _listMode.size(); i++) {
// _listMode.set(i, false);
// }
// _listMode.set(which, true);
dialog.dismiss();
// new AlertDialog.Builder(MainActivity.this)
// .setMessage("You selected: " + which + " , " + items[which])
// .show();
}
})
.create();
alertDialog.show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), e.getMessage().toString(), Toast.LENGTH_LONG)
.show();//("dialogModeFC", e.getMessage().toString());
}
}// end dialogModeFC
Physical pixel (px)
Density independent pixel (dp)
Dots per inch (dpi) .. physical pixels per inch
px = dp * (dpi / 160)
Density independent pixel (dp)
Dots per inch (dpi) .. physical pixels per inch
px = dp * (dpi / 160)
public static int dpToPx(int dp)
{
return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
}
public static int pxToDp(int px)
{
return (int) (px / Resources.getSystem().getDisplayMetrics().density);
}
Jak povolit komentáře je přihlášeným uživatelům.
Spam v komentářích je nepříjemný a zatěžuje server. Jednou z metod, jak jej omezit je povolit přidávat komentáře jen registrovaným členům. Toho ve Wordpress dosáhneme v administraci z menu Settings - Discussion kde zaškrtneme políčko Users must be registered and logged in to comment a nastaveni uložíme.
Spam v komentářích je nepříjemný a zatěžuje server. Jednou z metod, jak jej omezit je povolit přidávat komentáře jen registrovaným členům. Toho ve Wordpress dosáhneme v administraci z menu Settings - Discussion kde zaškrtneme políčko Users must be registered and logged in to comment a nastaveni uložíme.
For and continue statement in Java.
public class MainClass {
public static void main(String[] arg) {
String[] arrayOfString = { "Hello", "people", "hello", "world!" };
for (int i = 0; i < arrayOfString.length; i++){
if(arrayOfString[i].equals("hello"))
continue; // skip to for
System.out.println(arrayOfString[i]);
}
}
}
/*
Hello
people
world!
*/
If on Android emulator home button pressed.
Diagram of Activity lifecycle if button HOME pressed
// button home presssed
19:37:06.727: INFO/ActivityManager(60): Starting:
Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME]
flg=0x10200000 cmp=com.android.launcher/com.android.launcher2.Launcher } from pid 60
19:37:06.807: INFO/onSaveInstanceState(339): onSaveInstanceState()
19:37:06.848: INFO/onPause(339): onPause()
19:37:07.968: INFO/onStop(339): onStop()
Diagram of Activity lifecycle if button HOME pressed
Editace: 2013-12-09 13:07:42
Počet článků v kategorii: 396
Url:how-to-clear-or-hide-an-imageview-in-android