Not request focus EditText if startup Android
Not request focus EditText if startup Android - hide keyboard if startup.
Remove: from EditText
Create a LinearLayout and set the:
attributes android:focusable="true" android:focusableInTouchMode="true"
Remove:
Create a LinearLayout and set the:
attributes android:focusable="true" android:focusableInTouchMode="true"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical" >
</LinearLayout>
396LW NO topic_id
AD
Další témata ....(Topics)
Samsung Galaxy Ace nejlepší cena od 4 500 KCZ Kč (únor.2012)
Samsung Galaxy Ace je chytrý telefon s operačním systémem Android.
Samsung Galaxy Ace je (22.února2012) 4. nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.
Galaxy Ace je 3.5G smartphone nabízí i quad-band GSM. Displej je 3,5 palcový TFT kapacitní dotykový LCD HVGA s (320x480) rozlišením. K dispozici je také 5 megapixelový fotoaparát s LED bleskem. Je schopny zaznamenat video v rozlišení QVGA (320x240) a VGA s (640x480) rozlišením. Ace je dodáván s 1350mAh Li-Ion baterií. Ace běží s OS Android 2.2 Froyo a lze jej upgradovat na Android 2.3.6 Gingerbread.
Samsung Galaxy Ace photo pic image
Zdroj obrázku: wikipedia
Samsung Galaxy Ace je chytrý telefon s operačním systémem Android.
Samsung Galaxy Ace je (22.února2012) 4. nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.
Galaxy Ace je 3.5G smartphone nabízí i quad-band GSM. Displej je 3,5 palcový TFT kapacitní dotykový LCD HVGA s (320x480) rozlišením. K dispozici je také 5 megapixelový fotoaparát s LED bleskem. Je schopny zaznamenat video v rozlišení QVGA (320x240) a VGA s (640x480) rozlišením. Ace je dodáván s 1350mAh Li-Ion baterií. Ace běží s OS Android 2.2 Froyo a lze jej upgradovat na Android 2.3.6 Gingerbread.
Samsung Galaxy Ace photo pic image
Zdroj obrázku: wikipedia
Change table row background color if user click on row Android example code.
MainActivity.java
main.xml
strings.xml
MainActivity.java
public class MainActivity extends Activity {
Boolean bColorYellow = true;
TextView hTextView;
TableRow hTableRow;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
hTextView = (TextView)findViewById(R.id.idTextView);
hTableRow = (TableRow)findViewById(R.id.idTableRow1);
} // end onCreate
public void myTableRowClickHandler(View view) {
switch (view.getId()) {
case R.id.idTableRow1:{
if(bColorYellow){
hTableRow.setBackgroundColor(Color.GREEN);
bColorYellow = false;
}
else{
hTableRow.setBackgroundColor(Color.YELLOW);
bColorYellow = true;
}
}
break;
}
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/tableLayout1">
<TableRow android:id="@+id/idTableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#5655AA"
android:onClick="@string/myTableRowClick"
android:focusable="true">
<TextView
android:id="@+id/idTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</TableRow>
</TableLayout>
</LinearLayout>
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World!</string>
<string name="app_name">TableRow</string>
<string name="myTableRowClick">myTableRowClickHandler</string>
</resources>
RectF, drawRoundRect(),
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
canvas.drawColor(Color.GREEN);
Bitmap b = Bitmap.createBitmap(200, 200, Bitmap.Config.ALPHA_8);
Canvas c = new Canvas(b);
RectF rectF = new RectF();
rectF.set(5,5,150,150);
c.drawRoundRect(rectF, 10, 10, paint);
paint.setColor(Color.RED);
canvas.drawBitmap(b, 10,10, paint);
}
}
}
If some memory leak - problem try release of memory used of a big Bitmap what already not to need;
//developer.android.com/reference/android/graphics/Bitmap.html
Free the native object associated with this bitmap, and clear the reference to the pixel data. This will not free the pixel data synchronously; it simply allows it to be garbage collected if there are no other references. The bitmap is marked as "dead”, meaning it will throw an exception if getPixels() or setPixels() is called, and will draw nothing. This operation cannot be reversed, so it should only be called if you are sure there are no further uses for the bitmap. This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap.
Bitmpap bmp; // not null
bmp.recycle();
bmp = null;
final boolean bmpIsRecycled = bmp.isRecycled()
// Returns true if this bitmap has been recycled.
//developer.android.com/reference/android/graphics/Bitmap.html
Free the native object associated with this bitmap, and clear the reference to the pixel data. This will not free the pixel data synchronously; it simply allows it to be garbage collected if there are no other references. The bitmap is marked as "dead”, meaning it will throw an exception if getPixels() or setPixels() is called, and will draw nothing. This operation cannot be reversed, so it should only be called if you are sure there are no further uses for the bitmap. This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap.
Very very quick start of Android Emulator from Eclipse.
If will closed Android Emulator all data will saved on disk.
If will reopen Android Emulator, configuration and data will read from disk.
[caption id="attachment_768" align="alignleft" width="300" caption="android-emulator-enable-quick-start"][/caption]
- Go to Eclipse s menu Window -> Android SDK and AVD Manager
- Select Virtual devices
- Select check box Snapshot: Enabled
- Press Edit AVD button.
If will closed Android Emulator all data will saved on disk.
If will reopen Android Emulator, configuration and data will read from disk.
[caption id="attachment_768" align="alignleft" width="300" caption="android-emulator-enable-quick-start"][/caption]
Editace: 2013-02-01 16:57:04
Počet článků v kategorii: 396
Url:not-request-focus-edittext-if-startup-android