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.

Continue statement Java example


AD MOB

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!
*/

397LW NO topic_id




AD

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


13

Wordpress comments | wordpress-comments


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.
281

addPreferencesFromResource Deprecated Android Code Warning | addpreferencesfromresource-deprecated-android-code-warning


Put extends PreferenceFragment API level 11 instead PreferenceActivity

public class SettingsActivity extends PreferenceFragment {
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.preferences);
  }
}

// or insert suppresswarning
public class SettingsActivity extends PreferenceActivity {
  @SuppressWarnings("deprecation")
	@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.preferences);
  }
}

130

Bitmap get Bitmap from resource Android example | bitmap-get-bitmap-from-resource-android-example


PNG, GIF, BMP, JPG

// //www.apache.org/licenses/LICENSE-2.0

// 1.)  Bitmap from stream
            InputStream is = context.getResources().openRawResource(R.drawable.my_image);
            mBitmap = BitmapFactory.decodeStream(is);
           

// 2.) 
            Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.ball);
            int dstWidth =120;
            int dstHeight = 120;
            mBitmap = Bitmap.createScaledBitmap(ball, dstWidth, dstHeight, true);

// 3.)
Bitmap  mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);


        Bitmap  mBitmap;
        Canvas  mCanvas;
        Paint   mBitmapPaint;
            
            mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
            mCanvas = new Canvas(mBitmap);
            mBitmapPaint = new Paint(Paint.DITHER_FLAG);

// 4.)
          Bitmap  mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.RGB_565);
          Canvas  mCanvas.setBitmap(mBitmap);
            mCanvas.drawColor(0xFFFFFFFF);

275

SD card SDcard get external storage directory Android | sd-card-get-external-storage-directory-android


Environment.getExternalStorageDirectory()+ File.separator


Boolean canWrite =	Environment.getExternalStorageDirectory().canWrite() ;
if(canWrite){
File f = new File(Environment.getExternalStorageDirectory()
                        + File.separator + "my_image.jpg")
f.createNewFile();
}else{

}

AndroidManifest.xml
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
118

Android Api level - SDK version - how get Api level on device - sample | android-api-level-sdk-version-how-get-api-level-on-device-sample



import android.os.Build.VERSION;
//
int nSdkVersion = Integer.parseInt(Build.VERSION.SDK);
int nApiVersion = VERSION.SDK;






















Platform Version API Level
Android 4.0 14
Android 3.2 13
Android 3.1.x 12
Android 3.0.x 11
Android 2.3.4 10
Android 2.3.3 10
Android 2.3.2 9
Android 2.3.1 9
Android 2.3 9
Android 2.2.x 8
Android 2.1.x 7
Android 2.0.1 6
Android 2.0 5
Android 1.6 4
Android 1.5 3
Android 1.1 2
Android 1.0 1


Editace: 2011-10-04 08:57:55
Počet článků v kategorii: 397
Url:continue-statement-java-example

AD
11 Share
Share
Tweet