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.

Eclipse - How open deleted project from workspace


If project is in workspace and only not visible in project explorer using this:



Click on some project in project explorer
Menu:
File
Import project
Existing Projects into Workspace



397LW NO topic_id



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


8

Display screen size resolution density dimension Android | display-screen-dimension


Get display, screen resolution - dimension Android phone development example source code.

 Display display = getWindowManager().getDefaultDisplay();
int nWidth = display.getWidth();
int nHeight = display.getHeight();

          DisplayMetrics metrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(metrics);
            //get density per inch for example: 120 , 160 , 240
            mXDpi = metrics.xdpi; // 160 The exact physical pixels per inch of the screen in the X dimension. 
            mYDpi = metrics.ydpi;

// density
int nDensity = metrics.densityDpi; // 160 screen density expressed as dots-per-inch

          float  mMetersToPixelsX = mXDpi / 0.0254f; // 1 inch == 0.0254 metre
          float  mMetersToPixelsY = mYDpi / 0.0254f;
          
// Resolution
// The total number of physical pixels on a screen.
int wPix = metrics.widthPixels; // 320 The absolute width of the display in pixels.
int hPix = metrics.heightPixels; // 480 The absolute height of the display in pixels.
int nWidthDisplay = (wPix < hPix)? wPix : hPix;

float nWidthScreenInInch = wPix / mXDpi; //320 / 160 == 2.0 in inch.
float nHeightScreenInInch = hPix / mYDpi; //480 / 160 == 3.0 in inch.

// for example:
// density 120 per inch
//width 320 pix / 120 dpi == width 2.66 inch
//height 480 pix / 120 dpi == height 4.0 inch 

// density 240 per inch
//width 320 pix / 240 dpi == width 1.33 inch
//height 480 pix / 240 dpi == height 2.0 inch 




Example:
HTC Desire HD
11 (4.3) Diagonal cm (in)
480×800 Resolution
85 (217) ppcm (PPI - Pixels per inch)

480 / 217 = 2.21 inch
800 / 217 = 3.69 inch
Math.sqrt( 2.21*2.21 + 3.69 * 3.69) = 4.3 inch - diagonal

//en.wikipedia.org/wiki/Pixels_per_inch
//en.wikipedia.org/wiki/Dots_per_inch

Typical screen widths:

320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).


Emulator skins in the Android SDK
//developer.android.com/guide/practices/screens_support.html









































Low density (120), ldpi

Medium density (160), mdpi

High density (240), hdpi

Extra high density (320), xhdpi

Small screen
QVGA (240x320) 480x640

Normal screen
WQVGA400 (240x400)

WQVGA432 (240x432)
HVGA (320x480) WVGA800 (480x800)

WVGA854 (480x854)

600x1024
640x960

Large screen
WVGA800** (480x800)

WVGA854** (480x854)
WVGA800* (480x800)

WVGA854* (480x854)

600x1024

Extra Large screen
1024x600 WXGA (1280x800)

1024x768
1280x768
1536x1152
1920x1152

1920x1200
2048x1536
2560x1536

2560x1600
* To emulate this configuration, specify a
custom density of 160 when creating an AVD that uses a WVGA800 or WVGA854 skin.

** To emulate this configuration, specify a custom density of 120 when creating an AVD that
uses a WVGA800 or WVGA854 skin.

† This skin is available with the Android 3.0 platform
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

31

Start Activity from ListView item click Android example | start-activity-from-listview-item-click-android-example


How start certain Activity if user clicked to ListView item
Start Activity from list – launches other activities from list - latest variant!!!!


public class Main extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        try {
        setContentView(R.layout.main);
        
			ListView mlistView = (ListView) findViewById(R.id.idListView);
			mlistView.setAdapter(new ArrayAdapter<String>(this,
			        android.R.layout.simple_list_item_1, 
			        new String[] {"Game", "Help", "Home site"}));
    
        mlistView.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
              // When clicked, show a toast with the TextView text Game, Help, Home
              Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
                  Toast.LENGTH_SHORT).show();
              String sText = ((TextView) view).getText().toString();
              Intent intent = null;
              if(sText.equals("Game"))
              intent = new Intent(getBaseContext(),
						Game.class);
              //else if(sText.equals("Help")) ..........

              if(intent != null)
				startActivity(intent);              
            }
          });
        } catch (Exception e) {
        	// TODO Auto-generated catch block
        	e.printStackTrace();
        }
    
    }
}



Game class Game.java game.xml
You have to add class Game to AndroidManifest.xml

        <activity android:name=".Game" android:label="GameLabel">
        </activity>





package cz.okhelp.listview;

import android.app.Activity;
import android.os.Bundle;

public class Game extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        // you have to create game.xml 
        setContentView(R.layout.game);
    }
}




170

webcoreglue(): The real object has been deleted Emulator Error | webcoreglue-the-real-object-has-been-deleted-emulator-error


Error for example:
webcoreglue(2075): The real object has been deleted

Solution:
If this error message shows if orientation the screen is changed
try insert into AndroidManifest.xml this code:
android:configChanges="keyboard|keyboardHidden|orientation"

      <activity
            android:label="@string/app_name"
            android:name=".MyActivity" 
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            >

259

Two boolean as one parameter value in function Java | two-boolean-as-one-parameter-value-in-function-java



boolean fc(boolean b) {
	return b;
}// end fc
		boolean bA = true;
		boolean bB = true;
		boolean bC = bA || bB; // true

		bA = true;
		bB = false;
		bC = bA || bB; // true

		bA = false;
		bB = true;
		bC = bA || bB; // true

		bA = false;
		bB = false;
		bC = bA || bB; // false
		
			if(!fc(bB||bA))
			System.out.println("false"); // false
                        else 
			System.out.println("true"); 




Editace: 2014-02-15 20:22:10
Počet článků v kategorii: 397
Url:eclipse-how-open-deleted-project-from-workspace
Share
Share
Tweet