android Programming Glossary: pointer
Android Image View Pinch Zooming http://stackoverflow.com/questions/10630373/android-image-view-pinch-zooming static final String LOG_TAG TouchImageView The ˜active pointer is the one currently moving our object. private int mActivePointerId.. 0 break case MotionEvent.ACTION_MOVE final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX.. ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move if the ScaleGestureDetector..
android CountDownTimer - additional milliseconds delay between ticks http://stackoverflow.com/questions/12762272/android-countdowntimer-additional-milliseconds-delay-between-ticks in the java android world. Thanks buddies for any pointer ... android share improve this question Rewrite As you..
dynamically add and remove view to viewpager http://stackoverflow.com/questions/13664155/dynamically-add-and-remove-view-to-viewpager it will call destroyItem which will in turn cause a null pointer ref. pager.setAdapter null views.remove position pager.setAdapter..
How to select and crop an image in android? http://stackoverflow.com/questions/2085003/how-to-select-and-crop-an-image-in-android the i.putExtra crop true Logcat does not give me the null pointer exception and I am able to do what I want with the image. So..
More efficient way of updating UI from Service than intents? http://stackoverflow.com/questions/2621395/more-efficient-way-of-updating-ui-from-service-than-intents to the currently active activity. You can also maintain a pointer to the currently active activity if there is more than one and..
Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” http://stackoverflow.com/questions/2634991/android-1-6-android-view-windowmanagerbadtokenexception-unable-to-add-window this.getApplicationContext must go and instead you use a pointer to the activity you're in probably this . I got bitten by this..
Simple example of <merge> and <include> usage in Android XML-layouts http://stackoverflow.com/questions/2732682/simple-example-of-merge-and-include-usage-in-android-xml-layouts happy if someone could provide such an example or give a pointer to one. xml android layout merge include share improve this..
Android internet connectivity check problem http://stackoverflow.com/questions/2753412/android-internet-connectivity-check-problem I disable the 3G connection. My application throws a null pointer exception when I call isConnectedOrConnecting . The same thing..
Android : Loading an image from the Web with Asynctask http://stackoverflow.com/questions/3090650/android-loading-an-image-from-the-web-with-asynctask big because this will result in the task having a implicit pointer to the underlying activity causing the garbage collector to..
Android save view to jpg or png http://stackoverflow.com/questions/3107527/android-save-view-to-jpg-or-png EDIT I tried out your suggestions and am getting a null pointer at the Starred Line. import java.io.File import java.io.FileNotFoundException..
Finish parent and current activity in Android http://stackoverflow.com/questions/3410295/finish-parent-and-current-activity-in-android .finish If I switch the last two lines I also get a null pointer. android activity share improve this question I don't know..
Clear the entire history stack and start a new activity on Android http://stackoverflow.com/questions/3473168/clear-the-entire-history-stack-and-start-a-new-activity-on-android calling getParent .finish this always results in a null pointer exception. FLAG_ACTIVITY_CLEAR_TOP only works if the activity..
Is it possible to add an array or object to SharedPreferences on Android http://stackoverflow.com/questions/3876680/is-it-possible-to-add-an-array-or-object-to-sharedpreferences-on-android have an array list of objects that have a name and an icon pointer. I do not want to use a database. android android preferences..
enable/disable zoom in Android WebView http://stackoverflow.com/questions/5125851/enable-disable-zoom-in-android-webview . In OnTouchEvent for ACTION_DOWN I check how many pointers there are using MotionEvent.getPointerCount . If there is more.. MotionEvent.getPointerCount . If there is more than one pointer I call setSupportZoom true otherwise I call setSupportZoom false..
Image in Canvas with touch events http://stackoverflow.com/questions/5743328/image-in-canvas-with-touch-events 0 break case MotionEvent.ACTION_MOVE final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX.. ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move if the ScaleGestureDetector.. final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move if the ScaleGestureDetector isn't processing..
install / uninstall APKs programmatically (PackageManager vs Intents) http://stackoverflow.com/questions/6813322/install-uninstall-apks-programmatically-packagemanager-vs-intents or if the named package is a system package . TODO include pointer to documentation on system packages @param packageName The name..
Fit image into ImageView, keep aspect ratio and then resize ImageView to image dimensions? http://stackoverflow.com/questions/8232608/fit-image-into-imageview-keep-aspect-ratio-and-then-resize-imageview-to-image-d
Read & writing arrays of Parcelable objects http://stackoverflow.com/questions/10071502/read-writing-arrays-of-parcelable-objects loopIndex tmpList.get loopIndex But now I get a NullPointerException . Is above approach is correct Why it is throwing an.. casted to MyClass array MyClass . But now i get Null Pointer Exception. It is hard to tell the exact cause without the detailed..
Android Gallery zoom in/out http://stackoverflow.com/questions/11468536/android-gallery-zoom-in-out event if event.getAction MotionEvent.ACTION_MOVE event.getPointerCount 1 midPoint mid event if mid.y start.y Log.i TAG Going down.. event.getAction MotionEvent.ACTION_POINTER_DOWN Log.e TAG Pointer went down event.getPointerCount return true else if event.getAction.. Log.e TAG Pointer went down event.getPointerCount return true else if event.getAction MotionEvent.ACTION_UP..
Face Recognition on Android http://stackoverflow.com/questions/11699744/face-recognition-on-android Loader.load public FaceRecognizer public FaceRecognizer Pointer p super p public abstract native void train @ByRef MatVector.. it looks like this public static class MatVector extends Pointer static load public MatVector allocate public MatVector long.. public MatVector long n allocate n public MatVector Pointer p super p private native void allocate private native void allocate..
Android Null Exception on Calling function http://stackoverflow.com/questions/17781069/android-null-exception-on-calling-function parameter but on click the android throws an error of Null Pointer Exception. and application crashes .. i am stuck here kindly..
Android: How to create a Dialog without a title? http://stackoverflow.com/questions/2644134/android-how-to-create-a-dialog-without-a-title R.id.nr .setText number If I use this code I get a null Pointer Exception in the last line. The dialog is not null so the TextView..
GoogleMaps MapView crashes onTap in Android? http://stackoverflow.com/questions/3319158/googlemaps-mapview-crashes-ontap-in-android 07 23 16 24 48.167 ERROR AndroidRuntime 2530 java.lang.NullPointerException 07 23 16 24 48.167 ERROR AndroidRuntime 2530 at com.android.internal.app.AlertController.. geoPoint new GeoPoint int lat 1000000 int lng 1000000 Pointer new OverlayItem geoPoint Thats me wohooo itemizedOverlay.addOverlay.. geoPoint Thats me wohooo itemizedOverlay.addOverlay Pointer mapOverlays.add itemizedOverlay MapView.setSatellite false MapController..
Implement page curl on android? http://stackoverflow.com/questions/3912849/implement-page-curl-on-android Vertex3f v1 First stage of the deformation Vertex3f vo Pointer to the finished vertex CGFloat R r beta for ushort ii 0 ii numVertices_..
Page curl/turn effect in Android [duplicate] http://stackoverflow.com/questions/4376962/page-curl-turn-effect-in-android Vertex3f v1 First stage of the deformation Vertex3f vo Pointer to the finished vertex CGFloat R r beta for ushort ii 0 ii numVertices_..
How can I programmatically open/close notifications in Android? http://stackoverflow.com/questions/5029354/how-can-i-programmatically-open-close-notifications-in-android that method name for 4.2.2 and above you will get a Null Pointer Exception. So the code should be Object sbservice getSystemService..
Custom ListView with Date as SectionHeader (Used custom SimpleCursorAdapter) http://stackoverflow.com/questions/6261593/custom-listview-with-date-as-sectionheader-used-custom-simplecursoradapter cursor long id cursor.getPosition I am getting Null Pointer Exception at line Cursor date adapter.fetchTodo id Seems that..
Android ViewPager and ListViews http://stackoverflow.com/questions/7376613/android-viewpager-and-listviews in please let me know. The issue is that I get a Null Pointer Exception on this line when trying to launch my activity listView1.setAdapter..
Android Image View Pinch Zooming http://stackoverflow.com/questions/10630373/android-image-view-pinch-zooming private static final int INVALID_POINTER_ID 1 private static final String LOG_TAG TouchImageView The ˜active pointer is the one currently moving our object. private int mActivePointerId INVALID_POINTER_ID public TouchImageViewSample Context.. y ev.getY mLastTouchX x mLastTouchY y mActivePointerId ev.getPointerId 0 break case MotionEvent.ACTION_MOVE final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move.. 0 break case MotionEvent.ACTION_MOVE final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move if the ScaleGestureDetector isn't processing a gesture. if mScaleDetector.isInProgress..
android CountDownTimer - additional milliseconds delay between ticks http://stackoverflow.com/questions/12762272/android-countdowntimer-additional-milliseconds-delay-between-ticks was wondering if there is already a better CountDownTimer available in the java android world. Thanks buddies for any pointer ... android share improve this question Rewrite As you said you also noticed that the next time in onTick is calculated..
dynamically add and remove view to viewpager http://stackoverflow.com/questions/13664155/dynamically-add-and-remove-view-to-viewpager views that's because while ViewPager deletes all its views it will call destroyItem which will in turn cause a null pointer ref. pager.setAdapter null views.remove position pager.setAdapter this return position Returns the view at position..
How to select and crop an image in android? http://stackoverflow.com/questions/2085003/how-to-select-and-crop-an-image-in-android Logcat tells me that selectedImage is null. If I comment out the i.putExtra crop true Logcat does not give me the null pointer exception and I am able to do what I want with the image. So what is the problem here Does any one have any idea how I can..
More efficient way of updating UI from Service than intents? http://stackoverflow.com/questions/2621395/more-efficient-way-of-updating-ui-from-service-than-intents can then pass this information along in one way or another to the currently active activity. You can also maintain a pointer to the currently active activity if there is more than one and make decisions whether or not to simply update the current..
Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” http://stackoverflow.com/questions/2634991/android-1-6-android-view-windowmanagerbadtokenexception-unable-to-add-window improve this question i.e. this line Context appContext this.getApplicationContext must go and instead you use a pointer to the activity you're in probably this . I got bitten by this today too the annoying part is the getApplicationContext..
Simple example of <merge> and <include> usage in Android XML-layouts http://stackoverflow.com/questions/2732682/simple-example-of-merge-and-include-usage-in-android-xml-layouts but haven't yet found a simple example usage. Would be happy if someone could provide such an example or give a pointer to one. xml android layout merge include share improve this question some_activity.xml LinearLayout xmlns android http..
Android internet connectivity check problem http://stackoverflow.com/questions/2753412/android-internet-connectivity-check-problem 1.5 of Android when 3G is enabled but it crashes when I disable the 3G connection. My application throws a null pointer exception when I call isConnectedOrConnecting . The same thing also happens on my HTC Desire running Android 2.1. Hope that..
Android : Loading an image from the Web with Asynctask http://stackoverflow.com/questions/3090650/android-loading-an-image-from-the-web-with-asynctask the download of the image. I wrote if you Image is not that big because this will result in the task having a implicit pointer to the underlying activity causing the garbage collector to hold the whole activity in memory until the task is finished...
Android save view to jpg or png http://stackoverflow.com/questions/3107527/android-save-view-to-jpg-or-png that I would like to save. Sample code would be very helpful. EDIT I tried out your suggestions and am getting a null pointer at the Starred Line. import java.io.File import java.io.FileNotFoundException import java.io.FileOutputStream import android.app.Activity..
Finish parent and current activity in Android http://stackoverflow.com/questions/3410295/finish-parent-and-current-activity-in-android intent ActivityB.this.finish ActivityB.this.getParent .finish If I switch the last two lines I also get a null pointer. android activity share improve this question I don't know if this will work but you could try it From Activity A start..
Clear the entire history stack and start a new activity on Android http://stackoverflow.com/questions/3473168/clear-the-entire-history-stack-and-start-a-new-activity-on-android found anything that answers this exact question. I tried calling getParent .finish this always results in a null pointer exception. FLAG_ACTIVITY_CLEAR_TOP only works if the activity is already on the stack. android android activity stack ..
Is it possible to add an array or object to SharedPreferences on Android http://stackoverflow.com/questions/3876680/is-it-possible-to-add-an-array-or-object-to-sharedpreferences-on-android on Android If not is there any workaround I have an array list of objects that have a name and an icon pointer. I do not want to use a database. android android preferences sharedpreferences share improve this question So from..
enable/disable zoom in Android WebView http://stackoverflow.com/questions/5125851/enable-disable-zoom-in-android-webview ended up doing was subclassing WebView and overriding OnTouchEvent . In OnTouchEvent for ACTION_DOWN I check how many pointers there are using MotionEvent.getPointerCount . If there is more than one pointer I call setSupportZoom true otherwise I.. for ACTION_DOWN I check how many pointers there are using MotionEvent.getPointerCount . If there is more than one pointer I call setSupportZoom true otherwise I call setSupportZoom false . I then call the super.OnTouchEvent . This will effectively..
Image in Canvas with touch events http://stackoverflow.com/questions/5743328/image-in-canvas-with-touch-events ev.getY mLastTouchX x mLastTouchY y mActivePointerId ev.getPointerId 0 break case MotionEvent.ACTION_MOVE final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move.. break case MotionEvent.ACTION_MOVE final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move if the ScaleGestureDetector isn't processing a gesture. if mScaleDetector.isInProgress.. final int pointerIndex ev.findPointerIndex mActivePointerId final float x ev.getX pointerIndex final float y ev.getY pointerIndex Only move if the ScaleGestureDetector isn't processing a gesture. if mScaleDetector.isInProgress final float dx x..
install / uninstall APKs programmatically (PackageManager vs Intents) http://stackoverflow.com/questions/6813322/install-uninstall-apks-programmatically-packagemanager-vs-intents permission if the named package cannot be found or if the named package is a system package . TODO include pointer to documentation on system packages @param packageName The name of the package to delete @param observer An observer callback..
Fit image into ImageView, keep aspect ratio and then resize ImageView to image dimensions? http://stackoverflow.com/questions/8232608/fit-image-into-imageview-keep-aspect-ratio-and-then-resize-imageview-to-image-d
Read & writing arrays of Parcelable objects http://stackoverflow.com/questions/10071502/read-writing-arrays-of-parcelable-objects for int loopIndex 0 loopIndex tmpList.size loopIndex mObjList loopIndex tmpList.get loopIndex But now I get a NullPointerException . Is above approach is correct Why it is throwing an NPE android parcelable share improve this question ERROR.. returns Parcelable array Parcelable which can not be simply casted to MyClass array MyClass . But now i get Null Pointer Exception. It is hard to tell the exact cause without the detailed exception stack trace. Suppose you have made MyClass..
Android Gallery zoom in/out http://stackoverflow.com/questions/11468536/android-gallery-zoom-in-out return imageView public boolean onTouch View v MotionEvent event if event.getAction MotionEvent.ACTION_MOVE event.getPointerCount 1 midPoint mid event if mid.y start.y Log.i TAG Going down Math.abs mid.y start.y Math.abs mid.y start.y and zoom zoom.. event zoom zoom 0.1f zoomList false return true else if event.getAction MotionEvent.ACTION_POINTER_DOWN Log.e TAG Pointer went down event.getPointerCount return true else if event.getAction MotionEvent.ACTION_UP Log.i TAG Pointer going up return.. false return true else if event.getAction MotionEvent.ACTION_POINTER_DOWN Log.e TAG Pointer went down event.getPointerCount return true else if event.getAction MotionEvent.ACTION_UP Log.i TAG Pointer going up return true else if event.getAction..
Face Recognition on Android http://stackoverflow.com/questions/11699744/face-recognition-on-android cv public static class FaceRecognizer extends Algorithm static Loader.load public FaceRecognizer public FaceRecognizer Pointer p super p public abstract native void train @ByRef MatVector src @Adapter ArrayAdapter CvArr labels public abstract native.. defined in opencv_core line 4629 at time of writing this and it looks like this public static class MatVector extends Pointer static load public MatVector allocate public MatVector long n allocate n public MatVector Pointer p super p private native.. MatVector extends Pointer static load public MatVector allocate public MatVector long n allocate n public MatVector Pointer p super p private native void allocate private native void allocate @Cast size_t long n public native long size public native..
Android Null Exception on Calling function http://stackoverflow.com/questions/17781069/android-null-exception-on-calling-function change color on button click by passing color integer as a parameter but on click the android throws an error of Null Pointer Exception. and application crashes .. i am stuck here kindly help me please function name is SetColor MyView Class public..
Android: How to create a Dialog without a title? http://stackoverflow.com/questions/2644134/android-how-to-create-a-dialog-without-a-title dialog builder.create TextView dialog.findViewById R.id.nr .setText number If I use this code I get a null Pointer Exception in the last line. The dialog is not null so the TextView I try to retrieve does not exist. If I uncomment the..
GoogleMaps MapView crashes onTap in Android? http://stackoverflow.com/questions/3319158/googlemaps-mapview-crashes-ontap-in-android added the application crashes with a null pointer exception 07 23 16 24 48.167 ERROR AndroidRuntime 2530 java.lang.NullPointerException 07 23 16 24 48.167 ERROR AndroidRuntime 2530 at com.android.internal.app.AlertController AlertParams. init AlertController.java.. itemizedOverlay new MapItemizedOverlay positionMarker geoPoint new GeoPoint int lat 1000000 int lng 1000000 Pointer new OverlayItem geoPoint Thats me wohooo itemizedOverlay.addOverlay Pointer mapOverlays.add itemizedOverlay MapView.setSatellite.. GeoPoint int lat 1000000 int lng 1000000 Pointer new OverlayItem geoPoint Thats me wohooo itemizedOverlay.addOverlay Pointer mapOverlays.add itemizedOverlay MapView.setSatellite false MapController MapView.getController MapController.setCenter geoPoint..
Implement page curl on android? http://stackoverflow.com/questions/3912849/implement-page-curl-on-android curling using.html void deform Vertex2f vi Current input vertex Vertex3f v1 First stage of the deformation Vertex3f vo Pointer to the finished vertex CGFloat R r beta for ushort ii 0 ii numVertices_ ii Get the current input vertex. vi inputMesh_..
Page curl/turn effect in Android [duplicate] http://stackoverflow.com/questions/4376962/page-curl-turn-effect-in-android curling using.html void deform Vertex2f vi Current input vertex Vertex3f v1 First stage of the deformation Vertex3f vo Pointer to the finished vertex CGFloat R r beta for ushort ii 0 ii numVertices_ ii Get the current input vertex. vi inputMesh_..
How can I programmatically open/close notifications in Android? http://stackoverflow.com/questions/5029354/how-can-i-programmatically-open-close-notifications-in-android was changed to expandNotificationsPanel . If you don't use that method name for 4.2.2 and above you will get a Null Pointer Exception. So the code should be Object sbservice getSystemService statusbar Class statusbarManager Class.forName android.app.StatusBarManager..
Custom ListView with Date as SectionHeader (Used custom SimpleCursorAdapter) http://stackoverflow.com/questions/6261593/custom-listview-with-date-as-sectionheader-used-custom-simplecursoradapter public void bindView View convertView Context context Cursor cursor long id cursor.getPosition I am getting Null Pointer Exception at line Cursor date adapter.fetchTodo id Seems that Cursor is not getting any data. android sqlite android listview..
Android ViewPager and ListViews http://stackoverflow.com/questions/7376613/android-viewpager-and-listviews examples of any projects you've implemented this sort of thing in please let me know. The issue is that I get a Null Pointer Exception on this line when trying to launch my activity listView1.setAdapter new ArrayAdapter Object this R.layout.rowlayout..
|