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.

The container JRE System Library JavaSE references non existing library



Eclipse Error: The container JRE System Library JavaSE references non existing library QTJava.zip

Workaround:
Windows->Preferences->Java->Installed JRE
Press Add and select your JRE folder path for example:
c:\Program Files\Java\jre7\
and check your choice.

eclipse instaled jres path dialog

397LW NO topic_id



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


363

Save Instance State if device is rotated | save-instance-state-if-device-is-rotated


Try this trick.
In AndroidManifest - activity tag write this code
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
App hold data of a views if will to rotation of device.


       <activity
 android:name=".Tests_Activity"
 android:label="@string/app_name"
 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
236

tag should specify a target API level Warning | uses-sdk-tag-should-specify-target-api


Warning in AndroidManifest.xml:
tag should specify a target API level (the highest verified version; when running on
later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?"

Solution:

    <uses-sdk android:minSdkVersion="4"
         android:targetSdkVersion="16" />
30

Alert messagebox toast Android example code | alert-messagebox-toast-android-example-code


Toast in Android application is equivalent of Alert in JavaScript or MessageBox in WinApi.


// Toast android.widget.Toast.makeText(Context context, CharSequence text, int duration)
// public static Toast makeText (Context context, CharSequence text, int duration) 

Toast.makeText(getApplicationContext(), "Hello world!",
                  Toast.LENGTH_SHORT).show();

116

AlertDialog - MessageBox - Alert - Toast - Android sample | alertdialog-like-messagebox-android-sample


AlertDialog like MessageBox by WinApi:
If error: Unable to add window -- token null is not for an application
try change get Context.

// you can put this text into some function body or case in switch statement
                new AlertDialog.Builder(this)
                    .setMessage("Hello boys!!!")
                    .setPositiveButton("OK", null)
                    .show();



Context context = getApplicationContext();
	AlertDialog.Builder builder = new AlertDialog.Builder(context);
	builder.setTitle("Select font size");
	final CharSequence[] chsSize= { "Small", "Medium", "Large"};
	builder.setSingleChoiceItems(chsSize, 0 /*sel.item*/, 
	new DialogInterface.OnClickListener() {
 	    public void onClick(DialogInterface dialog, int item) {
	    		 Toast.makeText(context, "Hello from dialog!!!", Toast.LENGTH_SHORT).show();
	        dialog.dismiss();
	    }
	});
	AlertDialog alert = builder.create();
	alert.show();
    
148

Crop cropped cut bitmap image pictures Android example | crop-cropped-cut-bitmap-image-pictures-android-example


Cut, shear, clip, snip, crop a bitmap, picture, 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);


			// you need to insert a image flower_blue into res/drawable folder
			paint.setFilterBitmap(true);
			Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),
					R.drawable.flower_blue);

			Bitmap croppedBmp = Bitmap.createBitmap(bitmapOrg, 0, 0,
					bitmapOrg.getWidth() / 2, bitmapOrg.getHeight());
			int h = bitmapOrg.getHeight();
			canvas.drawBitmap(bitmapOrg, 10, 10, paint);
			canvas.drawBitmap(croppedBmp, 10, 10 + h + 10, paint);

		}

	}
}



crop bitmap android


Editace Jana Žákovská : 2014-02-15 20:28:56
Počet článků v kategorii: 397
Url:the-container-jre-system-library-javase-references-non-existing-library
Share
Share
Tweet