Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

fragment Binary XML file line Must specify unique android:id, android:tag, or have a parent with an id for

FrameLayou, fragment have to unique id android:id="@+id/your_id_unique"

<FrameLayout xmlns:android="//schemas.android.com/apk/res/android"
    xmlns:tools="//schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <fragment
        android:id="@+id/your_id_unique"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="cz.okhelp.notepad.AddNoteFragment"
        tools:layout="@layout/add_note" />

</FrameLayout>

396LW NO topic_id




AD

Další témata ....(Topics)


147

Resize a bitmap image Android example | resize-a-bitmap-image-android-example



public class ApokusActivity 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.YELLOW);
            
	         
	         paint.setFilterBitmap(true);
	         Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),R.drawable.flower_blue);
	         int targetWidth  = bitmapOrg.getWidth() * 2;
	         int targetHeight = bitmapOrg.getHeight() * 2;
	         Bitmap bmp = Bitmap.createBitmap(targetWidth, targetHeight,Bitmap.Config.ARGB_8888);
	         RectF rectf = new RectF(0, 0, targetWidth, targetHeight);
	         Canvas c = new Canvas(bmp);
	         Path path = new Path();
	         path.addRect(rectf, Path.Direction.CW);
	         c.clipPath(path);
	         c.drawBitmap( bitmapOrg, new Rect(0, 0, bitmapOrg.getWidth(), bitmapOrg.getHeight()),
	                         new Rect(0, 0, targetWidth, targetHeight), paint);
	         Matrix matrix = new Matrix();
	         matrix.postScale(1f, 1f);
	         Bitmap resizedBitmap = Bitmap.createBitmap(bmp, 0, 0, targetWidth, targetHeight, matrix, true);
	         int h = bitmapOrg.getHeight();
           canvas.drawBitmap(bitmapOrg, 10,10, paint);
           canvas.drawBitmap(resizedBitmap, 10,10 + h + 10, paint);
           
		}

	}
}


android/resize-bitmap-android.png
335

Android emulator freezes at startup create new virtual device | android-emulator-freezes-at-startup-create-new-virtual-device


If Android emulator freezes at startup, try create new virtual device with smaller memory and cpu usage, or select older version of Android, or buy new pc with higher performance.

  1. open AVD MANAGER

  2. press Create Virtual Device

  3. select Device with small memory usage (e.g. 480x800 of resolution) - Next

  4. check - Show downloadable ....

  5. Download - lower version of system Android, select, press - Next

  6. check data, Show Advanced Settings, check Use host... and press Finish


android/android-studio-create-virtual-device-emulator.png
179

HTC Incredible 2 | htc-incredible-2


HTC Incredible 2 cena od 6 000 KCZ Kč (únor.2012)
Spokojenost uživatelů nadprůměrná.
HTC Incredible 2 je chytrý telefon s operačním systémem Android.
HTC Incredible 2 je (22.února2012) 7. nejpoužívanějším chytrým telefonem u programu Sky Map viz tabulka.

HTC Incredible 2 - video recense