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.

Turn screen ON OFF Android sample code



WakeLock, PowerManager,uses-permission Android sample.
Main.java

public class Main extends Activity {
	    private SensorManager mSensorManager;
	    private PowerManager mPowerManager;
	    private WindowManager mWindowManager;
	    private WakeLock mWakeLock;
	    private Button button;
	    private TextView textView;

	    /** Called when the activity is first created. */
	    @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
try{
	        // Get an instance of the SensorManager
	        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);

	        // Get an instance of the PowerManager
	        mPowerManager = (PowerManager) getSystemService(POWER_SERVICE);

	        // Get an instance of the WindowManager
	        mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
	        mWindowManager.getDefaultDisplay();

	        // Create a bright wake lock
	        mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass()
	                .getName());

	        setContentView(R.layout.main);
	        textView = (TextView)findViewById(R.id.textView1);
	        button = (Button)findViewById(R.id.button1);
	        button.setOnClickListener(mButtonStopListener);
	       
	        
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			Log.e("onCreate", e.getMessage());
		}
} // END onCreate
	    
	    View.OnClickListener mButtonStopListener = new OnClickListener() {
	    	public void onClick(View v) {
		        try {
					mWakeLock.release();
					textView.setText("mWakeLock.release()");
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					Log.e("onPause",e.getMessage());
				}
	    	
	    	}
	    };

	    @Override
	    protected void onResume() {
	        super.onResume();
	        /*
	         * when the activity is resumed, we acquire a wake-lock so that the
	         * screen stays on, since the user will likely not be fiddling with the
	         * screen or buttons.
	         */
	        
	        try {
				mWakeLock.acquire();
				textView.setText("mWakeLock.acquire()");
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				Log.e("onResume", e.getMessage());
			}

	    }

	    @Override
	    protected void onPause() {
	        super.onPause();

	        // and release our wake-lock
	        try {
				mWakeLock.release();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				Log.e("onPause",e.getMessage());
			}
	    }
}



AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="//schemas.android.com/apk/res/android"
      package="cz.okhelp.Main"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />
    <uses-permission android:name="android.permission.HARDWARE_TEST"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>

<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".ScreenBrightnessActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>



397LW NO topic_id



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


112

How to capture screenshot of emulator window - Android sample | how-to-capture-screenshot-of-emulator-window-android-sample


When Eclipse and the emulator runs.
To access the DDMS perspective, go to Window > Open Perspective > DDMS. If DDMS does not appear, go to Window > Open Perspective > Other ... and select DDMS.

Open Devices TAB. Window -> Show view -> Devices

From Devices TAB select Screen Capture
Android emlator screen capture by eclipse
273

How to add or remove widgets home screen android 4 | how-to-add-or-remove-widgets-home-screen-android-4


Video tutorial
How to add or remove widgets home screen Android 4.

174

Android Java functions samples | android-java-functions-samples


Java Android functions and method examples of using.

.abs

.accept

.acquire

.add

.addAccountExplicitly

.addAction

.addAnimation

.addBitmap

.addCallback

.addCategory

.addCircle

.addDataScheme

.addEarcon

.addEmail

.addFirst

.addFlags

.addGesture

.addHeader

.addIntentOptions

.addName

.addOnGestureListener

.addPhone

.addPhotos

.addPreference

.addRule

.addShape

.addTab

.addTextChangedListener

.addURI

.addVertex

.addView

.adjustMetaAfterKeypress

.allocate

.allocateDirect

.alpha

.animate

.animateTransform

.answerCall

.append

.appendEncodedPath

.appendId

.appendWhere

.applyBatch

.arcTo

.argb

.arraycopy

.asFloatBuffer

.asIntBuffer

.asInterface

.asShortBuffer

.assignContactUri

.attachInterface

.attemptAuth

.authenticate

.available

.BackupAgent#onBackup

.BackupAgent#onRestore

.basicTypes

.beginAdding

.beginBatchEdit

.beginBroadcast

.beginDrawing

.blockingGetAuthToken

.blue

.build

.Builder

.buildUpon

.callActivityOnPause

.callActivityOnResume

.Callback#onKeyDown

.cancel

.cancelDiscovery

.charAt

.check

.checkArgument

.checkNotNull

.clear

.clearCheck

.clearHistory

.clearMetaKeyStates

.clearPhotos

.clearQueue

.clipPath

.clipRect

.close

.closing

.colorChanged

.commit

.commitText

.compare

.compareTo

.compile

.compress

.compressTexture

.computeBounds

.computePhysics

.concat

.connect

.ContactListAdapter

.contains

.copyPixelsFromBuffer

.copyStringToBuffer

.cos

.create

.createBitmap

.createBufferObjects

.createFromAsset

.createFromPdu

.createFromResource

.createFromStream

.createNewContact

.createRfcommSocketToServiceRecord

.createScaledBitmap

.Creator

.cubicTo

.currentAnimationTimeMillis

.currentTimeMillis

.dataChanged

.decodeByteArray

.decodeResource

.decodeStream

.delete

.deleteTitlePref

.dismiss

.dispatchDraw

.dispatchKeyEvent

.divideMessage

.doKeyDown

.doKeyUp

.doStart

.draw

.drawArc

.drawBitmap

.drawBitmapMesh

.drawCircle

.drawColor

.drawLine

.drawLines

.drawOval

.drawPaint

.drawPath

.drawPicture

.drawPoints

.drawPosText

.drawRect

.drawText

.drawTextOnPath

.drawVertices

.duration

.edit

.elapsedRealtime

.elementAt

.encode

.endAdding

.endAnimation

.endBatchEdit

.endCall

.endDrawing

.endRecording

.enforceInterface

.equals

.eraseColor

.execSQL

.execute

.exists

.extractAlpha

.fade

.fetchFriendStatuses

.fetchFriendUpdates

.filter

.findItem

.findNextFocus

.findPointerIndex

.findViewById

.finish

.finishBroadcast

.finishComposingText

.format

.forName

.from

.fromContext

.fromFile

.fromHtml

.fromInt

.fromString

.frustumM

.generate

.get

.getAbsolutePath

.getAction

.getActionMasked

.getActivity

.getActivityInfo

.getAdapter

.getArray

.getAttributeValue

.getBandLevelRange

.getBinder

.getBondedDevices

.getBoolean

.getBooleanExtra

.getBounds

.getBroadcast

.getBroadcastItem

.getBundle

.getBundleExtra

.getBytes

.getCameraInfo

.getCheckedRadioButtonId

.getChildCount

.getClassName

.getColor

.getColumnIndex

.getColumnIndexOrThrow

.getComponent

.getContent

.getContentDescription

.getContentResolver

.getContext

.getCount

.getCurrentItemIndex

.getCurrentModelView

.getCurrentPlayer

.getCurrentProjection

.getData

.getDataSize

.getDeadChar

.getDefault

.getDefaultAdapter

.getDefaultDisplay

.getDefaultSensor

.getDefaultSharedPreferences

.getDeviceConfigurationInfo

.getDimensionPixelOffset

.getDimensionPixelSize

.getDouble

.getDrawable

.getEmail

.getEntity

.getExternalMediaDir

.getExternalStoragePublicDirectory

.getExternalStorageState

.getExtras

.getFirstName

.getFirstVisiblePosition

.getFontMetrics

.getGesture

.getGestureEntries

.getHeight

.getHistoricalPressure

.getHistoricalTouchMajor

.getHistoricalX

.getHistoricalY

.getHistorySize

.getHolder

.getIBinder

.getIcon

.getIndexCount

.getInputStream

.getInstance

.getInstrumentation

.getInt

.getIntArray

.getInteger

.getIntExtra

.getIntrinsicHeight

.getIntrinsicWidth

.getItem

.getItemAtPosition

.getItemCount

.getJetPlayer

.getJSONArray

.getJSONObject

.getKey

.getKeyboard

.getLanguage

.getLastPathSegment

.getLayoutParams

.getLocationOnScreen

.getLong

.getLooper

.getMatrix

.getMaxCaptureRate

.getMeasuredHeight

.getMeasuredWidth

.getMenuInfo

.getMode

.getName

.getNumberOfBands

.getNumberOfCameras

.getNumStars

.getOnlyElement

.getOpacity

.getOriginatingAddress

.getOutputStream

.getPackageInfo

.getPackageManager

.getPackageName

.getPackedPositionChild

.getPackedPositionGroup

.getPackedPositionType

.getPadding

.getPaddingRight

.getPageContent

.getPaint

.getParameters

.getParams

.getParcelable

.getParcelableArrayExtra

.getParcelableExtra

.getParticleCount

.getPassword

.getPathSegments

.getPayload

.getPeerProfile

.getPid

.getPixels

.getPointerCount

.getPointerId

.getPosX

.getPosY

.getReadableDatabase

.getRecentTasks

.getRecords

.getRemoteDevice

.getResourceId

.getResources

.getRight

.getRingerMode

.getRootDirectory

.getSavedText

.getScaledHeight

.getScaledWidth

.getSelectedItemPosition

.getSelection

.getService

.getSharedPreferences

.getSize

.getSpinnerPosition

.getSpinnerSelection

.getStatusLine

.getStepSize

.getStore

.getStreamMaxVolume

.getStreamVolume

.getString

.getStringArray

.getStringArrayListExtra

.getStringExtra

.getStrokePaint

.getStrokeWidth

.getSurfaceFrame

.getSyncAdapterBinder

.getSystem

.getText

.getTextBounds

.getTextSize

.getTextWidths

.getThread

.getTnf

.getTransformation

.getType

.getUnicodeChar

.getUserId

.getValue

.getView

.getWidth

.getWord

.getWordMatches

.getWritableDatabase

.getX

.getXPrecision

.getY

.getYPrecision

.glActiveTexture

.glAlphaFunc

.glAlphaFuncx

.glAttachShader

.glBindBuffer

.glBindFramebufferOES

.glBindRenderbufferOES

.glBindTexture

.glBlendFunc

.glBufferData

.glCheckFramebufferStatusOES

.glClear

.glClearColor

.glClearColorx

.glClearDepthf

.glClearDepthx

.glClearStencil

.glClientActiveTexture

.glClipPlanef

.glClipPlanex

.glColor4f

.glColor4x

.glColorMask

.glColorPointer

.glCompileShader

.glCompressedTexImage2D

.glCompressedTexSubImage2D

.glCopyTexImage2D

.glCopyTexSubImage2D

.glCreateProgram

.glCreateShader

.glCullFace

.glCurrentPaletteMatrixOES

.glDeleteProgram

.glDeleteShader

.glDeleteTextures

.glDepthFunc

.glDepthMask

.glDepthRangef

.glDepthRangex

.glDisable

.glDisableClientState

.glDrawArrays

.glDrawElements

.glDrawTexfOES

.glDrawTexfvOES

.glDrawTexiOES

.glDrawTexivOES

.glDrawTexsOES

.glDrawTexsvOES

.glDrawTexxOES

.glDrawTexxvOES

.glEnable

.glEnableClientState

.glEnableVertexAttribArray

.glFinish

.glFlush

.glFogf

.glFogfv

.glFogx

.glFogxv

.glFramebufferRenderbufferOES

.glFramebufferTexture2DOES

.glFrontFace

.glFrustumf

.glFrustumx

.glGenBuffers

.glGenFramebuffersOES

.glGenRenderbuffersOES

.glGenTextures

.glGetAttribLocation

.glGetError

.glGetIntegerv

.glGetProgramiv

.glGetShaderiv

.glGetString

.glGetUniformLocation

.glHint

.glLightf

.glLightfv

.glLightModelf

.glLightModelfv

.glLightModelx

.glLightModelxv

.glLightx

.glLightxv

.glLineWidth

.glLineWidthx

.glLinkProgram

.glLoadIdentity

.glLoadMatrixf

.glLoadMatrixx

.glLoadPaletteFromModelViewMatrixOES

.glLogicOp

.glMaterialf

.glMaterialfv

.glMaterialx

.glMaterialxv

.glMatrixIndexPointerOES

.glMatrixMode

.glMultiTexCoord4f

.glMultiTexCoord4x

.glMultMatrixf

.glMultMatrixx

.glNormal3f

.glNormal3x

.glNormalPointer

.glOrthof

.glOrthox

.glPixelStorei

.glPointSize

.glPointSizex

.glPolygonOffset

.glPolygonOffsetx

.glPopMatrix

.glPushMatrix

.glQueryMatrixxOES

.glReadPixels

.glRenderbufferStorageOES

.glRotatef

.glRotatex

.glSampleCoverage

.glSampleCoveragex

.glScalef

.glScalex

.glScissor

.glShadeModel

.glShaderSource

.glStencilFunc

.glStencilMask

.glStencilOp

.glTexCoordPointer

.glTexEnvf

.glTexEnvfv

.glTexEnvx

.glTexEnvxv

.glTexGeni

.glTexImage2D

.glTexParameterf

.glTexParameteri

.glTexParameteriv

.glTexParameterx

.glTexSubImage2D

.glTranslatef

.glTranslatex

.gluLookAt

.glUniformMatrix4fv

.glUseProgram

.glVertexAttribPointer

.glVertexPointer

.glViewport

.glWeightPointerOES

.green

.group

.handleKeyDown

.handleKeyUp

.handleMessage

.has

.hasCategory

.hasEnded

.hashCode

.hasStarted

.height

.includeAllPackagesUnderHere

.incrementProgressBy

.incrementSecondaryProgressBy

.indexOf

.inflate

.init

.initialize

.insert

.insertStatuses

.interrupt

.invalidate

.invalidateAuthToken

.invert

.invoke

.isAdminActive

.isChecked

.isColumnCollapsed

.isColumnShrinkable

.isColumnStretchable

.isInProgress

.isInside

.iterator

.join

.kill

.killProcess

.lastIndexOf

.layout

.LayoutParams

.length

.lineTo

.ListAdapter#getCount

.ListAdapter#getItem

.ListAdapter#getItemId

.ListAdapter#getView

.Listener

.listenUsingRfcommWithServiceRecord

.load

.loadAllTitlePrefs

.loadAnimation

.loadData

.loadIcon

.loadJetFile

.loadLabel

.loadLayoutAnimation

.loadTexture

.loadTitlePref

.lockCanvas

.lockNow

.makeAudioCall

.makeMeasureSpec

.makeText

.mapPoints

.matcher

.max

.measure

.measureText

.min

.mkdirs

.MorseCodeConverterTest#testCharacterS

.moveTo

.moveToFirst

.multiply

.multiplyMM

.multiplyMV

.mutate

.myPid

.nanoTime

.newDelete

.newInsert

.newInstance

.newPullParser

.newUpdate

.newView

.newWakeLock

.next

.nextBoolean

.nextInt

.notify

.notifyDataSetChanged

.obtain

.obtainMessage

.obtainStyledAttributes

.offsetTo

.onActivityResult

.onAttachedToWindow

.onBackup

.onBindView

.onCellSelected

.OnCheckedChangeListener

.OnClickListener

.onContextItemSelected

.onCreate

.onCreateContextMenu

.onCreateDialog

.onCreateOptionsMenu

.OnDateSetListener

.onDestroy

.onDetachedFromWindow

.onDrag

.onDraw

.OnEditorActionListener

.onFinishInput

.onFocusChanged

.OnItemSelectedListener#onItemSelected

.onKeyDown

.onKeyUp

.onLongPress

.onMeasure

.OnMultiChoiceClickListener

.onNewIntent

.onOptionsItemSelected

.onPause

.onPostExecute

.onPreExecute

.onPrepareDialog

.onPrepareOptionsMenu

.onProgressUpdate

.onRestore

.onRestoreInstanceState

.onResume

.onSaveInstanceState

.onScale

.OnScanCompletedListener

.onSizeChanged

.onStart

.onStartInput

.onStartInputView

.onStop

.onSurfaceChanged

.onSurfaceCreated

.onSurfaceDestroyed

.OnTimeSetListener

.onTouchEvent

.onTransact

.onUpdateSelection

.onWindowFocusChanged

.open

.openRawResource

.Options

.order

.orthoM

.parse

.parseFloat

.parseInt

.parseLong

.pattern

.pause

.performClick

.performOnBackgroundThread

.pickSuggestionManually

.play

.playEarcon

.poll

.position

.post

.postConcat

.postDelayed

.postTranslate

.prepare

.prepareUserAgent

.preTranslate

.printStackTrace

.project

.Proxy

.put

.putBoolean

.putBundle

.putDouble

.putExtra

.putIndices

.putInt

.putIntArray

.putLong

.putParcelable

.putString

.putStringArrayList

.quadTo

.query

.queryIntentActivities

.queueJetSegment

.quit

.random

.read

.readBoolean

.readDouble

.readEntityData

.readException

.readFloat

.readInt

.readLong

.readString

.recycle

.red

.registerCallback

.registerListener

.registerOnSharedPreferenceChangeListener

.registerReceiver

.release

.remove

.removeActiveAdmin

.removeAllViews

.removeCallbacks

.removeElementAt

.removeGesture

.removeItem

.removeMessages

.removeView

.requery

.requestFocus

.reset

.resetPassword

.resolveActivity

.resolveCollisionWithBounds

.restore

.restoreState

.restoreToCount

.results

.rewind

.rotate

.rotateY

.round

.run

.runOnUiThread

.save

.saveLayer

.saveLayerAlpha

.saveRecentQuery

.saveState

.scale

.scaleM

.scanFile

.schedule

.send

.sendEmptyMessage

.sendEmptyMessageDelayed

.sendKeys

.sendMessage

.sendMessageDelayed

.sendTextMessage

.sendToTarget

.set

.setAction

.setActivity

.setActivityToSpoof

.setAdapter

.setAdjustViewBounds

.setAlpha

.setAlphabeticShortcut

.setAngle

.setAnimationListener

.setAntiAlias

.setARGB

.setAudioStreamType

.setBackgroundColor

.setBackgroundDrawable

.setBackgroundResource

.setBandLevel

.setBase

.setBitmap

.setBounds

.setButton

.SetButtonView

.setCamera

.setCancelable

.setCaptureSize

.setCell

.setCellListener

.setChecked

.setChoiceMode

.setClass

.setClassName

.setClickable

.setColor

.setColorFilter

.setColumnCollapsed

.setColumnShrinkable

.setColumnStretchable

.setComponent

.setComponentEnabledSetting

.setCompoundDrawables

.setCompoundDrawablesWithIntrinsicBounds

.setConnectionTimeout

.setContent

.setContentView

.setCornerRadii

.setCurrentHour

.setCurrentMinute

.setCurrentPlayer

.setCurrentView

.setData

.setDataCaptureListener

.setDataSource

.setDefaultValues

.setDialogTitle

.setDialogue

.setDifficulty

.setDisplay

.setDither

.setDrawFilter

.setDrawingCacheEnabled

.setDropDownViewResource

.setDuration

.setEGLConfigChooser

.setEGLContextClientVersion

.setEmpty

.setEnabled

.setEntity

.setEntries

.setEntryValues

.setError

.setEventListener

.setExpanded

.setFaceColor

.setFactory

.setFakeBoldText

.setFavorites

.setFillAfter

.setFillType

.setFilterBitmap

.setFinished

.setFixedSize

.setFlags

.setFocusable

.setFocusableInTouchMode

.setFormat

.setGameState

.setGesture

.setGLWrapper

.setGradientRadius

.setGradientType

.setGravity

.setGroupVisible

.setHeader

.setHeaderTitle

.setHeight

.setHorizontalGravity

.setIcon

.setId

.setIdentity

.setIdentityM

.setImageBitmap

.setImageDrawable

.setImageResource

.setImageViewResource

.setImeOptions

.setInAnimation

.setIndeterminate

.setIndicator

.setInput

.setIntent

.setInterpolator

.setIntrinsicHeight

.setIntrinsicWidth

.setItems

.setItemsCanFocus

.setKey

.setKeyboard

.setLang

.setLanguage

.setLatestEventInfo

.setLayoutAnimation

.setLayoutAnimationListener

.setLayoutParams

.setLayoutResource

.setLength

.setLocalMatrix

.setLookAtM

.setMargins

.setMaskFilter

.setMax

.setMaximumFailedPasswordsForWipe

.setMaximumTimeToLock

.setMediaController

.setMessage

.setMinimumWidth

.setMode

.setMovementMethod

.setMultiChoiceItems

.setMuteArray

.setMuteFlag

.setNegativeButton

.setNeutralButton

.setNotificationUri

.setNotifyOnChange

.setNumStars

.setOnBufferingUpdateListener

.setOnCancelListener

.setOnCheckedChangeListener

.setOnClickListener

.setOnClickPendingIntent

.setOnCompletionListener

.setOnEditorActionListener

.setOnItemClickListener

.setOnItemSelectedListener

.setOnKeyboardActionListener

.setOnKeyListener

.setOnPreparedListener

.setOnSeekBarChangeListener

.setOnTimeChangedListener

.setOnTouchListener

.setOnVideoSizeChangedListener

.setOrientation

.setOutAnimation

.setPadding

.setParameters

.setPassword

.setPasswordMinimumLength

.setPasswordQuality

.setPathEffect

.setPersistentDrawingCache

.setPixels

.setPolyToPoly

.setPositiveButton

.setPreviewDisplay

.setPreviewSize

.setProgress

.setProgressStyle

.setProjectionMap

.setPrompt

.setRating

.setRecents

.setRectToRect

.setRegistrationListener

.setRenderer

.setRepeatCount

.setRepeating

.setRepeatMode

.setRGB2YUV

.setRotate

.setRotateM

.setRunning

.setScale

.setScaleType

.setScreenHeight

.setScreenWidth

.setSelection

.setService

.setShader

.setShape

.setShifted

.setSingleChoiceItems

.setSingleLine

.setSoTimeout

.setSpan

.setSpeakerMode

.setSpinnerPosition

.setSpinnerSelection

.setStartOffset

.setState

.setStepSize

.setStrokeCap

.setStrokeJoin

.setStrokeWidth

.setStyle

.setSuggestions

.setSummary

.setSurfaceSize

.setSyncAutomatically

.setTables

.setTag

.setText

.setTextAlign

.setTextColor

.setTextKeepState

.setTextSize

.SetTextView

.setTextViewText

.setTime

.setTimeInMillis

.setTimeout

.setTimerView

.setTimeZone

.setTitle

.setTokenizer

.setToNow

.setTranslate

.setType

.setTypeface

.setUp

.setValue

.setVerticalGravity

.setVideoPath

.setVideoURI

.setView

.setVisibility

.setWinner

.setXfermode

.setYUV2RGB

.show

.shutdown

.SimpleOnScaleGestureListener

.sin

.size

.skipEntityData

.sleep

.sort

.speak

.split

.sqrt

.start

.startActivity

.startAnimation

.startAudio

.startDiscovery

.startFlipping

.startHierarchyTracing

.startLayoutAnimation

.startNow

.startPreview

.startService

.startSimulation

.startsWith

.Status

.Status>

.step

.stop

.stopBlink

.stopHierarchyTracing

.stopPreview

.stopSelf

.stopSimulation

.Stub

.subSequence

.substring

.switchCamera

.syncContacts

.synchronizedMap

.TabSpec#setContent

.TabSpec#setIndicator

.takeAudioCall

.tearDown

.texImage2D

.toBitmap

.toByteArray

.toggle

.toggleMute

.toHexString

.toLowerCase

.toString

.toUpperCase

.transact

.transformVertex

.translate

.translateM

.triggerClip

.unlockCanvasAndPost

.unpause

.unregisterCallback

.unregisterListener

.unregisterReceiver

.update

.updateAppWidget

.updateEmail

.updateExistingContact

.updateName

.updatePhone

.updateStatus

.updateVisualizer

.uptimeMillis

.valueChanged

.valueOf

.vibrate

.wait

.width

.wipeData

.withAppendedId

.withAppendedPath

.withValue

.withValueBackReference

.withValues

.write

.writeBoolean

.writeDouble

.writeEntityData

.writeEntityHeader

.writeFloat

.writeInt

.writeInterfaceToken

.writeLong

.writeNoException

.writeString

.writeStrongBinder

.writeTexture

.writeToParcel

.writeToStream

219

Throwing multiple exceptions Java | throwing-multiple-exceptions-java


Throws multiple exceptions Java example source code

	public void callFc() 
	throws IndexOutOfBoundsException, ArithmeticException
	{
         // my code for example:
         String[] sArray = {"aa","bb"};
         String str = sArray[5]; // IndexOutOfBoundsException

         int n = 5 / 0; // ArithmeticException
        }

public void someFC (){
try{
     callFc();
    }
 catch(IndexOutOfBoundsException e){
      Log.e("TAG", e.toString());
  }
 catch(ArithmeticException e2){ 
      Log.e2("TAG",e2.toString()); 
  }
}

274

Open Close Hide Project in Eclipse - save memory | close-hide-project-in-eclipse-save-memory


Close one project:¨
-right click on project
- select Close project

Close more projects:
- right click on project
- select Close Unrelated Projects

Hide closed projects:
- package explorer
- view menu
- select Closed projects

eclipse-close-project

eclipse-close-projects

eclipse-open-projec


Editace Jana Žákovská : 2011-10-19 16:06:44
Počet článků v kategorii: 397
Url:turn-screen-on-off-android-sample-code
Share
Share
Tweet