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.

Error android.widget.LinearLayout.measureHorizontal LinearLayout.java


AD MOB

Code with error:

ImageView imgV = (ImageView)findViewById(R.id.myView);
        imgV.setLayoutParams(new ViewGroup.LayoutParams(
        		ViewGroup.LayoutParams.WRAP_CONTENT,
        		0));


If you get error try this code:

        ViewGroup.LayoutParams layoutParams = imgV
				.getLayoutParams();
		layoutParams.height = 0;
		imgV.setLayoutParams(layoutParams);




java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:659)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:311)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:386)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
at android.view.View.measure(View.java:8313)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:531)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
at android.view.View.measure(View.java:8313)

397LW NO topic_id




AD

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


178

Samsung Galaxy Ace | samsung-galaxy-ace


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
samsung galaxy s2
Zdroj obrázku: wikipedia
263

Eclipse failed to create the java virtual machine - Android | eclipse-failed-to-create-the-java-virtual-machine-android


Eclipse: failed to create the java virtual machine - message box

  1. Open folder with Eclipse.exe and find eclipse.ini file

  2. Replace -vmargs
    by your current real path of javaw.exe:
    -vm "c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe"




-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-product
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm "c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe” 
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-Declipse.buildId=v21.1.0-569685
185

Get the color of a specific pixel Java Android example | get-the-color-of-a-specific-pixel-java-android-example



             ImputStream      is = this.getResources().openRawResource(R.drawable.colors);
             Bitmap    mBitmap2 = BitmapFactory.decodeStream(is);
        
         int  w = mBitmap2.getWidth();
         int  h = mBitmap2.getHeight();
//  int x , y have to be smaller as w , h 
         int _color =  mBitmap2.getPixel(x, y);

394

CSS circle style html | css-circle-style-html



      create div with class with name e.g. circle

      create in styleSheet.css class circle



html code

 <div class="circle" id="">3</div>


css code

.circle {
 border-radius: 50%;
    width: 50px;
    height: 50px;
    background: yellow;
    position: absolute;
    display: block;
    border: 6px solid blue;
    font-size: 50px;
    text-align: center;
}






3




















142

Create bitmap and draw text into bitmap Android example | create-bitmap-and-draw-text-into-bitmap-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.GREEN);
            
           Bitmap b = Bitmap.createBitmap(200, 200, Bitmap.Config.ALPHA_8);
           Canvas c = new Canvas(b);
           c.drawRect(0, 0, 200, 200, paint);
           
           paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
           paint.setTextSize(40);
           paint.setTextScaleX(1.f);
           paint.setAlpha(0);
           paint.setAntiAlias(true);
           c.drawText("Your text", 30, 40, paint);
           paint.setColor(Color.RED);
           
           canvas.drawBitmap(b, 10,10, paint);
		}

	}
}


draw-text-into-bitmap-android



Editace: 2013-12-09 10:23:15
Počet článků v kategorii: 397
Url:error-android-widget-linearlayout-measurehorizontal-linearlayout-java

AD
11 Share
Share
Tweet