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.

View overrides onTouchEvent but not performClick


AD MOB


public class Panel extends SurfaceView implements SurfaceHolder.Callback {
//............... code
//............... some code
   /**
     * Process the MotionEvent.
     */
    @Override
    public boolean onTouchEvent(MotionEvent event) {
    	
        synchronized (getHolder()) {
            if (event.getAction() == MotionEvent.ACTION_DOWN) {
            	performClick();
             } else if (event.getAction() == MotionEvent.ACTION_MOVE) {
            	if(_currentGraphic==null)return true;
                
            } else if (event.getAction() == MotionEvent.ACTION_UP) {
            }
            return true;
        }
    }
/////////////////////////////
 @Override
 public boolean performClick() {
  // Calls the super implementation, which generates an AccessibilityEvent
        // and calls the onClick() listener on the view, if any
        super.performClick();

        // Handle the action for the custom click here

        return true;
 }

}


397LW NO topic_id




AD

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


212

Accessibility Missing contentDescription attribute on image | accessibility-missing-contentdescription-attribute-on-image


Android Emulator warning:[Accessibility] Missing contentDescription attribute on image

Workaround example code:
android:contentDescription="@string/desc"

            <ImageView
                android:id="@+id/imageViewOil"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
            android:contentDescription="@string/desc"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="84dp"
                android:src="@drawable/tank_silver" />
119

Html List tag in Android TextView - Android sample | html-list-tag-in-android-textview-android-sample


Html.fromHtml(String) does not support all HTML tags. For example < ul > and < li > are not supported.
Try this source code as a substitute for HTML List Tags.

String str = 
  "•	Cessnock<br />"
 +"•	Dubbo<br />"
 +"•	Goulburn<br />"
 +"•	Grafton<br />"
 +"•	Lithgow<br />"
 +"•	Liverpool<br />"
 +"•	Newcastle<br />"
;

textview.setText(Html.fromHtml(str));


Result:
• Cessnock
• Dubbo
• Goulburn
• Grafton
• Lithgow
• Liverpool
• Newcastle

Supported tags

bla.com























a
b
big
blockquote
br
cite
dfn
div
em
font
h1-h6
i
img
p
small
strong
sub
sup
tt
u
172

Android Samples | android-samples











AbsListView
AbstractAccountAuthenticator
AbstractThreadedSyncAdapter
AccelerateInterpolator
AccessibilityEvent
AccessibilityService
AccessibilityServiceInfo
Account
AccountAuthenticatorActivity
AccountAuthenticatorResponse
AccountManager
Activity
ActivityInfo
ActivityInstrumentationTestCase2
ActivityManager
ActivityUnitTestCase
AdapterContextMenuInfo
AdapterView
AlarmManager
AlertDialog
AlphaAnimation
AndroidTestCase
Animation
AnimationSet
AnimationUtils
Application
ApplicationTestCase
AppWidgetManager
AppWidgetProvider
ArrayAdapter
AssetFileDescriptor
AsyncTask
AttributeSet
AudioManager
AuthenticatorDescription
AuthenticatorException
AutoCompleteTextView
BackupAgent
BackupAgentHelper
BackupDataInput
BackupDataOutput
BackupManager
BaseAdapter
BaseColumns
BaseExpandableListAdapter
Binder
Bitmap
BitmapDrawable
BitmapFactory
BitmapShader
BluetoothAdapter
BluetoothDevice
BluetoothServerSocket
BluetoothSocket
BroadcastReceiver
Build
Bundle
Button
Callback
Camera
CameraInfo
Canvas
Color
ColorFilter
CompletionInfo
ComponentName
CompoundButton
ConditionVariable
Config
ConfigurationInfo
Contacts
ContactsContract
ContentProvider
ContentProviderClient
ContentProviderOperation
ContentResolver
ContentUris
ContentValues
Context
ContextMenu
ContextMenuInfo
Cursor
CursorAdapter
Data
DatePicker
DatePickerDialog
DecelerateInterpolator
DeviceAdminReceiver
DevicePolicyManager
Dialog
DialogInterface
Display
DisplayMetrics
Drawable
Editable
EditorInfo
EditText
EditTextPreference
Email
Environment
Equalizer
ETC1Util
ExpandableListActivity
ExpandableListAdapter
ExpandableListContextMenuInfo
ExpandableListView
FileBackupHelper
FillType
Filterable
FloatMath
FocusFinder
FormatException
Gallery
Gesture
GestureDetector
GestureLibraries
GestureLibrary
GestureOverlayView
GLES10
GLES20
GLSurfaceView
GLU
GLUtils
Gravity
GridView
Handler
HandlerThread
Html
CharArrayBuffer
CheckBox
CheckBoxPreference
Chronometer
IBinder
Im
ImageButton
ImageSwitcher
ImageView
InputConnection
InputMethodManager
InputMethodService
Instrumentation
Intent
IntentFilter
JetPlayer
Key
Keyboard
KeyboardView
KeyEvent
KeyCharacterMap
LayoutAnimationController
LayoutInflater
LayoutParams
LinearLayout
LinkMovementMethod
ListActivity

ListAdapter
ListPreference
ListView
LiveFolders
Log
Looper
Matrix
MediaController
MediaPlayer
MediaScannerConnection
MediumTest
Menu
MenuInflater
MenuItem
Message
Messenger
MetaKeyKeyListener
MoreAsserts
MotionEvent
MovementMethod
MultiAutoCompleteTextView
NameNotFoundException
NdefMessage
NdefRecord
NfcAdapter
Notification
NotificationManager
OnAccountsUpdateListener
OnBufferingUpdateListener
OnClickListener
OnCompletionListener
OnCheckedChangeListener
OnInitListener
OnItemClickListener
OnItemSelectedListener
OnJetEventListener
OnKeyListener
OnPreparedListener
OnScrollListener
OnSharedPreferenceChangeListener
OnTouchListener
OnVideoSizeChangedListener
OperationApplicationException
OperationCanceledException
Options
PackageInfo
PackageManager
Paint
PaintDrawable
PaintFlagsDrawFilter
Parcel
Parcelable
ParcelFileDescriptor
Path
PendingIntent
People
Phone
Phones
Picture
PictureDrawable
PixelFormat
PorterDuff
PorterDuffXfermode
PowerManager
Preference
PreferenceActivity
PreferenceCategory
PreferenceManager
PreferenceScreen
Process
ProgressBar
ProgressDialog
QuickContactBadge
RadioButton
RadioGroup
RatingBar
RawContacts
RecognitionService
RecognizerIntent
Rect
RectF
RelativeLayout
RemoteCallbackList
RemoteException
RemoteViews
ResolveInfo
ResourceCursorAdapter
Resources
Row
ScaleGestureDetector
ScrollingMovementMethod
ScrollView
SearchManager
SearchRecentSuggestions
SearchRecentSuggestionsProvider
SeekBar
Sensor
SensorEvent
SensorEventListener
SensorManager
Service
ServiceConnection
ServiceTestCase
Shader
ShapeDrawable
SharedPreferences
SimpleAdapter
SimpleCursorAdapter
SimpleCursorTreeAdapter
SimpleExpandableListAdapter
Size
SmallTest
SmsManager
SmsMessage
SpannableString
Spanned
SparseArray
SpeechRecognizer
Spinner
SpinnerAdapter
SQLException
SQLiteDatabase
SQLiteOpenHelper
SQLiteQueryBuilder
StatusUpdates
StructuredName
Style
StyleSpan
Surface
SurfaceHolder
SurfaceView
SyncResult
SystemClock
TabActivity
TabHost
TableLayout
TableRow
TabSpec
TestSuiteBuilder
TextSwitcher
TextToSpeech
TextUtils
TextView
TextWatcher
Time
TimePicker
TimePickerDialog
Toast
ToggleButton
Transformation
TranslateAnimation
TypedArray
Typeface
UiThreadTest
Uri
UriMatcher
URLSpan
Vibrator
VideoView
View
ViewFlipper
ViewGroup
ViewParent
ViewSwitcher
Visualizer
WakeLock
WallpaperManager
WallpaperService
WebView
Window
WindowManager
Xfermode
Xml
XmlResourceParser

385

EditText.setOnKeyListener not working on maxLines EditText | edittext-setonkeylistener-not-working-on-maxlines-edittext


Check this in XML file if use singleLine
singleLine change to maxLines (1 if singleLine)
declare inputType


        android:maxLines="1"
        android:inputType="text"

356

No USB devices or running detected | no-usb-devices-or-running-detected


Check

  • is sett debug mode on device?

  • enabled debugging over USB?

  • is device right connected?

  • have you downloaded and instaled drivers for your device on PC?

  • For Windows //developer.android.com/sdk/win-usb.html

  • try disconnect and connect USB cable

  • try do restart Android Studio



Editace: 2015-02-21 20:04:24
Počet článků v kategorii: 397
Url:view-overrides-ontouchevent-but-not-performclick

AD
11 Share
Share
Tweet