android Programming Glossary: second
Android, How to manage start activity for result? http://stackoverflow.com/questions/10407159/android-how-to-manage-start-activity-for-result start activity for result In my activity i'm calling second activity from main activity by startActivityForResult . In my.. from main activity by startActivityForResult . In my second activity there are some methods that finish this activity maybe.. them return result. For example from main activity I call second one in this activity I'm checking some features of handset such..
Close/hide the Android Soft Keyboard http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard to pass in InputMethodManager.HIDE_IMPLICIT_ONLY as the second parameter to ensure you only hide the keyboard when the user..
Close application and launch home screen on Android http://stackoverflow.com/questions/2042222/close-application-and-launch-home-screen-on-android I have two different activities. The first launches the second one. In the second activity I call System.exit 0 in order to.. activities. The first launches the second one. In the second activity I call System.exit 0 in order to force the application..
NoClassDefFoundError - Eclipse and Android http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android trying to run an Android app which up until adding a second external library to its build path was working fine. Since having..
Declaring a custom android UI element using XML http://stackoverflow.com/questions/2695646/declaring-a-custom-android-ui-element-using-xml course if the return type is a primitive in which case the second argument is returned. If you don't want to retrieve all of the..
How to pass object from one activity to another in Android http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android to pass intent.putExtra MyClass obj to retrieve object in second Activity getIntent .getSerializableExtra MyClass share improve..
Launch custom android application from android browser http://stackoverflow.com/questions/2958701/launch-custom-android-application-from-android-browser String first params.get 0 status String second params.get 1 1234 You can do the above anywhere in your Activity..
Download a file with Android, and showing the progress in a ProgressDialog http://stackoverflow.com/questions/3028306/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog showing in the notification bar. Final thoughts First and second methods are just the tip of the iceberg. There are lots of things..
How to draw a path on a map using kml file? http://stackoverflow.com/questions/3109158/how-to-draw-a-path-on-a-map-using-kml-file 1 .split if first pair is not transferred completely take seconds pair TODO try GeoPoint startGP new GeoPoint int Double.parseDouble.. 0 gp2.getLongitudeE6 0 for GeoPoint first latitude second longitude gp2 new GeoPoint int Double.parseDouble lngLat 1..
WebView and HTML5 <video> http://stackoverflow.com/questions/3815090/webview-and-html5-video are still an important issue. I can play it only once. The second time I click on the video dispatcher either the poster or some.. of opening the Media Player window but this is for me a secondary issue. I hope it helps somebody and I would also thank any..
Running multiple AsyncTasks at the same time — not possible? http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible onCreate is done. bar bar bar bar bar bar bar bar bar The second AsyncTask never gets executed. If I change the order of the.. Suppose you have a custom AsyncTask that just sleeps a second in doInBackground . AsyncTasks use a fixed size queue internally..
How can I use the animation framework inside the canvas? http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas boolean ballFingerMove Measure frames per second. long now int framesCount 0 int framesCountAvg 0 long framesTimer.. not all canvas. Measure frame rate unit frames per second . now System.currentTimeMillis canvas.drawText framesCountAvg..
ViewPager PagerAdapter not updating the View http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view reload them all. As so the reload effect is obtained. The second option suggested by alvarolb is to setTag method in instantiateItem.. findViewWithTag to find the view you want to update. The second approach is very flexible and high performant. Kudos to alvarolb..
Update data in ListFragment as part of ViewPager http://stackoverflow.com/questions/7379165/update-data-in-listfragment-as-part-of-viewpager Can not perform this action after onSaveInstanceState. My second attempt involed trying to call an update function in my ListFragment..
Android Activity Life Cycle - What are all these methods for? http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for to the window manager. This is considered to be the second highest priority activity in the Android Activity stack and..
How to read pdf in my android application? [closed] http://stackoverflow.com/questions/10299839/how-to-read-pdf-in-my-android-application String path try final Intent intent new Intent First.this Second.class intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path.. startActivity intent catch Exception e e.printStackTrace Second.java public class Second extends PdfViewerActivity @Override.. Exception e e.printStackTrace Second.java public class Second extends PdfViewerActivity @Override public void onCreate Bundle..
Example of code to implement a PDF reader http://stackoverflow.com/questions/11152956/example-of-code-to-implement-a-pdf-reader path try final Intent intent new Intent First.this Second.class intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path.. import android.os.Bundle public class Second extends PdfViewerActivity @Override public void onCreate Bundle.. String path try final Intent intent new Intent First.this Second.class intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path..
Bitmap recycle with largeHeap enabled http://stackoverflow.com/questions/12716574/bitmap-recycle-with-largeheap-enabled inSampleSize Math.round float imageWidth float reqWidth Second way int inSampleSize Math.min imageWidth reqWidth imageHeight..
Google maps api v2 custom infowindow like in original android google maps http://stackoverflow.com/questions/14123243/google-maps-api-v2-custom-infowindow-like-in-original-android-google-maps live again the OnClickListeners will start triggering etc. Second part The remaining problem is that obviously you can't see any..
How to parse same name tag in Android XML DOM Parsing http://stackoverflow.com/questions/17421506/how-to-parse-same-name-tag-in-android-xml-dom-parsing My XML Looks like this MyResource Item First Item Item Second Item MyResource My ActivityClass method public class ShowItems..
How to transfer the formatted date string from my DatePickerFragment? http://stackoverflow.com/questions/18211684/how-to-transfer-the-formatted-date-string-from-my-datepickerfragment date TODO Auto generated method stub tv.setText date Second way not sure if this is the best way. I would recommend the..
How to set a timer in android http://stackoverflow.com/questions/1877417/how-to-set-a-timer-in-android . Once you receive a message you can run desired tasks. Second option would be to create a Runnable object and schedule it..
How to change the font on the TextView? http://stackoverflow.com/questions/2888508/how-to-change-the-font-on-the-textview First the default is not Arial. The default is Droid Sans. Second to change to a different built in font use android typeface..
Android and MJPEG http://stackoverflow.com/questions/3205191/android-and-mjpeg position .toString startActivity i Second activity package com.test import com.test.mjpeg.mjpegsample.MjpegView...
Adding a library/JAR to an Eclipse Android project http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project JAR and need the prefix somehow defined . What's going on Second after fixing that the answer is given below my application doesn't..
Programmatically switching off Android phone http://stackoverflow.com/questions/3745523/programmatically-switching-off-android-phone phone Can we switch off an Android phone programmatically Second question how to lock and unlock the screen in Android I am using..
SecurityException: caller uid XXXX is different than the authenticator's uid http://stackoverflow.com/questions/3774282/securityexception-caller-uid-xxxx-is-different-than-the-authenticators-uid post 613041897 caller uid is different Second if you are like me and want to embed the sample into your existing..
Alarm Manager Example http://stackoverflow.com/questions/4459058/alarm-manager-example System.currentTimeMillis 1000 60 10 pi Millisec Second Minute public void CancelAlarm Context context Intent intent..
Programatically Hide/Show Android Soft Keyboard [duplicate] http://stackoverflow.com/questions/7200281/programatically-hide-show-android-soft-keyboard have 2 EditText's One for username and one for password Second one have one ListView and an EditText to filter the listView.. Page I want my keyboard to be visible on start up.. On SecondPage I want keyboard to be hidden first only to appear when user.. keyboard.showSoftInput mUserNameEdit 0 50 Second answers is provided by @Dyarish Infact he linked to another..
Replace Fragment inside a ViewPager http://stackoverflow.com/questions/7723964/replace-fragment-inside-a-viewpager first one is the FirstPagerFragment the second one is the SecondPagerFragment. Clicking on a button of the first page. I'd like.. 0 return FirstPageFragment.newInstance else return SecondPageFragment.newInstance Second Page FRAGMENT public static.. else return SecondPageFragment.newInstance Second Page FRAGMENT public static class SecondPageFragment extends..
How to add a Dropdown item on the action bar http://stackoverflow.com/questions/8312344/how-to-add-a-dropdown-item-on-the-action-bar @ id menuSortRating android title Sort by rating menu item Second option menu options.xml menu xmlns android http schemas.android.com..
Store Android SQLite http://stackoverflow.com/questions/9140952/store-android-sqlite So Internal Memory is best till medium level database. Second Suggestion External Memory SD Card When you are storing database..
Android, How to manage start activity for result? http://stackoverflow.com/questions/10407159/android-how-to-manage-start-activity-for-result How to manage start activity for result In my activity i'm calling second activity from main activity by startActivityForResult . In my second activity there are some methods that finish this activity.. activity for result In my activity i'm calling second activity from main activity by startActivityForResult . In my second activity there are some methods that finish this activity maybe without result however just one of them return result. For.. this activity maybe without result however just one of them return result. For example from main activity I call second one in this activity I'm checking some features of handset such as does it have camera if it doesn't have then I'll close..
Close/hide the Android Soft Keyboard http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.HIDE_IMPLICIT_ONLY as the second parameter to ensure you only hide the keyboard when the user didn't explicitly force it to appear by holding down menu ...
Close application and launch home screen on Android http://stackoverflow.com/questions/2042222/close-application-and-launch-home-screen-on-android application and launch home screen on Android I have two different activities. The first launches the second one. In the second activity I call System.exit 0 in order to force the application to close but the first activity is automatically.. and launch home screen on Android I have two different activities. The first launches the second one. In the second activity I call System.exit 0 in order to force the application to close but the first activity is automatically displayed..
NoClassDefFoundError - Eclipse and Android http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android Eclipse and Android I'm having a problem trying to run an Android app which up until adding a second external library to its build path was working fine. Since having added the scoreninja jar I now get a NoClassDefFoundError..
Declaring a custom android UI element using XML http://stackoverflow.com/questions/2695646/declaring-a-custom-android-ui-element-using-xml in the defined in the XML then null is returned. Except of course if the return type is a primitive in which case the second argument is returned. If you don't want to retrieve all of the attributes it is possible to create this array manually.The..
How to pass object from one activity to another in Android http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android
Launch custom android application from android browser http://stackoverflow.com/questions/2958701/launch-custom-android-application-from-android-browser String host data.getHost twitter.com List String params data.getPathSegments String first params.get 0 status String second params.get 1 1234 You can do the above anywhere in your Activity but you're probably going to want to do it in onCreate..
Download a file with Android, and showing the progress in a ProgressDialog http://stackoverflow.com/questions/3028306/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog manager.enqueue request Download progress will be showing in the notification bar. Final thoughts First and second methods are just the tip of the iceberg. There are lots of things you have to keep in mind if you want your app to be robust...
How to draw a path on a map using kml file? http://stackoverflow.com/questions/3109158/how-to-draw-a-path-on-a-map-using-kml-file lngLat length lngLat.length if lngLat.length 3 lngLat pairs 1 .split if first pair is not transferred completely take seconds pair TODO try GeoPoint startGP new GeoPoint int Double.parseDouble lngLat 1 1E6 int Double.parseDouble lngLat 0 1E6 mMapView01.getOverlays.. 2 gp1.getLatitudeE6 0 gp1.getLongitudeE6 0 gp2.getLatitudeE6 0 gp2.getLongitudeE6 0 for GeoPoint first latitude second longitude gp2 new GeoPoint int Double.parseDouble lngLat 1 1E6 int Double.parseDouble lngLat 0 1E6 if gp2.getLatitudeE6..
WebView and HTML5 <video> http://stackoverflow.com/questions/3815090/webview-and-html5-video R.id.webview a.initWebView But now I should say there are still an important issue. I can play it only once. The second time I click on the video dispatcher either the poster or some play button it does nothing. I would also like the video.. also like the video to play inside the WebView frame instead of opening the Media Player window but this is for me a secondary issue. I hope it helps somebody and I would also thank any comment or suggestion. Saludos terrÃcolas. share improve..
Running multiple AsyncTasks at the same time — not possible? http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible foo bar bar bar foo foo foo And so on. However what I get is onCreate is done. bar bar bar bar bar bar bar bar bar The second AsyncTask never gets executed. If I change the order of the execute statements only the foo task will produce output. Am.. doInBackground yet. This is tested confirmed by me on 2.2. Suppose you have a custom AsyncTask that just sleeps a second in doInBackground . AsyncTasks use a fixed size queue internally for storing delayed tasks. Queue size is 10 by default...
How can I use the animation framework inside the canvas? http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas speed. float acc Bitmap ball bgr bgrReverse boolean reverseBackroundFirst boolean ballFingerMove Measure frames per second. long now int framesCount 0 int framesCountAvg 0 long framesTimer 0 Paint fpsPaint new Paint Frame speed long timeNow long.. matrix back to its saved position only the ball bitmap was rotated not all canvas. Measure frame rate unit frames per second . now System.currentTimeMillis canvas.drawText framesCountAvg fps 40 70 fpsPaint framesCount if now framesTimer 1000 framesTimer..
ViewPager PagerAdapter not updating the View http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view the view pager will remove all views and reload them all. As so the reload effect is obtained. The second option suggested by alvarolb is to setTag method in instantiateItem when instantiating a new view. Then instead of using..
Update data in ListFragment as part of ViewPager http://stackoverflow.com/questions/7379165/update-data-in-listfragment-as-part-of-viewpager the data sometimes but others I got an IllegalStateException Can not perform this action after onSaveInstanceState. My second attempt involed trying to call an update function in my ListFragment but getId in getItem returned 0. As per the docs I..
Android Activity Life Cycle - What are all these methods for? http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for they maintain all state and member information and remain attached to the window manager. This is considered to be the second highest priority activity in the Android Activity stack and as such will only be killed by the OS if killing this activity..
How to read pdf in my android application? [closed] http://stackoverflow.com/questions/10299839/how-to-read-pdf-in-my-android-application openPdfIntent path private void openPdfIntent String path try final Intent intent new Intent First.this Second.class intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path startActivity intent catch Exception e e.printStackTrace.. intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path startActivity intent catch Exception e e.printStackTrace Second.java public class Second extends PdfViewerActivity @Override public void onCreate Bundle savedInstanceState TODO Auto generated.. path startActivity intent catch Exception e e.printStackTrace Second.java public class Second extends PdfViewerActivity @Override public void onCreate Bundle savedInstanceState TODO Auto generated method stub super.onCreate..
Example of code to implement a PDF reader http://stackoverflow.com/questions/11152956/example-of-code-to-implement-a-pdf-reader openPdfIntent path private void openPdfIntent String path try final Intent intent new Intent First.this Second.class intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path startActivity intent catch Exception e e.printStackTrace.. package android.pdf.reader import net.sf.andpdf.pdfviewer.PdfViewerActivity import android.os.Bundle public class Second extends PdfViewerActivity @Override public void onCreate Bundle savedInstanceState TODO Auto generated method stub super.onCreate.. openPdfIntent path private void openPdfIntent String path try final Intent intent new Intent First.this Second.class intent.putExtra PdfViewerActivity.EXTRA_PDFFILENAME path startActivity intent catch Exception e e.printStackTrace..
Bitmap recycle with largeHeap enabled http://stackoverflow.com/questions/12716574/bitmap-recycle-with-largeheap-enabled Math.round float imageHeight float reqHeight else inSampleSize Math.round float imageWidth float reqWidth Second way int inSampleSize Math.min imageWidth reqWidth imageHeight reqHeight The you can set the inSampleSize options.inSampleSize..
Google maps api v2 custom infowindow like in original android google maps http://stackoverflow.com/questions/14123243/google-maps-api-v2-custom-infowindow-like-in-original-android-google-maps ev All this will make the views inside the InfoView live again the OnClickListeners will start triggering etc. Second part The remaining problem is that obviously you can't see any UI changes of your InfoWindow on screen. To do that you have..
How to parse same name tag in Android XML DOM Parsing http://stackoverflow.com/questions/17421506/how-to-parse-same-name-tag-in-android-xml-dom-parsing i have only shown the part which is responsible for parsing. My XML Looks like this MyResource Item First Item Item Second Item MyResource My ActivityClass method public class ShowItems extends Activity ListView lv ListAdapter adapter static final..
How to transfer the formatted date string from my DatePickerFragment? http://stackoverflow.com/questions/18211684/how-to-transfer-the-formatted-date-string-from-my-datepickerfragment menu return true @Override public void returnDate String date TODO Auto generated method stub tv.setText date Second way not sure if this is the best way. I would recommend the above interface method. public class MainActivity extends Activity..
How to set a timer in android http://stackoverflow.com/questions/1877417/how-to-set-a-timer-in-android long or sendMessageDelayed android.os.Message long . Once you receive a message you can run desired tasks. Second option would be to create a Runnable object and schedule it via Handler's functions postAtTime java.lang.Runnable long or..
How to change the font on the TextView? http://stackoverflow.com/questions/2888508/how-to-change-the-font-on-the-textview android fonts textview share improve this question First the default is not Arial. The default is Droid Sans. Second to change to a different built in font use android typeface in layout XML or setTypeface in Java. Third there is no Helvetica..
Android and MJPEG http://stackoverflow.com/questions/3205191/android-and-mjpeg IntentTest.this OtherActivity.class i.putExtra MAC myListView.getItemAtPosition position .toString startActivity i Second activity package com.test import com.test.mjpeg.mjpegsample.MjpegView. import com.test.parser.JSONParse public class OtherActivity..
Adding a library/JAR to an Eclipse Android project http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project unbound prefix because I'm trying to use a class from that JAR and need the prefix somehow defined . What's going on Second after fixing that the answer is given below my application doesn't work on Android and I discover via the debugger LogCat..
Programmatically switching off Android phone http://stackoverflow.com/questions/3745523/programmatically-switching-off-android-phone switching off Android phone Can we switch off an Android phone programmatically Second question how to lock and unlock the screen in Android I am using following snippet but it didn't work for me. KeyguardManager..
SecurityException: caller uid XXXX is different than the authenticator's uid http://stackoverflow.com/questions/3774282/securityexception-caller-uid-xxxx-is-different-than-the-authenticators-uid First check the condition explained on this post http loganandandy.tumblr.com post 613041897 caller uid is different Second if you are like me and want to embed the sample into your existing app for testing then make sure you use Constants class..
Alarm Manager Example http://stackoverflow.com/questions/4459058/alarm-manager-example context 0 i 0 am.setRepeating AlarmManager.RTC_WAKEUP System.currentTimeMillis 1000 60 10 pi Millisec Second Minute public void CancelAlarm Context context Intent intent new Intent context Alarm.class PendingIntent sender PendingIntent.getBroadcast..
Programatically Hide/Show Android Soft Keyboard [duplicate] http://stackoverflow.com/questions/7200281/programatically-hide-show-android-soft-keyboard worked for me.. I have two screens in my app. First one have 2 EditText's One for username and one for password Second one have one ListView and an EditText to filter the listView In my first screen I want username EditText to have focus on.. 0 To simplify On Login Page first Page I want my keyboard to be visible on start up.. On SecondPage I want keyboard to be hidden first only to appear when user touches editText And my problem is I am getting exact opposite.. keyboard InputMethodManager getSystemService Context.INPUT_METHOD_SERVICE keyboard.showSoftInput mUserNameEdit 0 50 Second answers is provided by @Dyarish Infact he linked to another SO thread which I havent seen before. But the funny thing is..
Replace Fragment inside a ViewPager http://stackoverflow.com/questions/7723964/replace-fragment-inside-a-viewpager with another one. The pager is composed by two pages. The first one is the FirstPagerFragment the second one is the SecondPagerFragment. Clicking on a button of the first page. I'd like to to replace the FirstPagerFragment with the NextFragment... @Override public Fragment getItem int position if position 0 return FirstPageFragment.newInstance else return SecondPageFragment.newInstance Second Page FRAGMENT public static class SecondPageFragment extends Fragment public static SecondPageFragment.. int position if position 0 return FirstPageFragment.newInstance else return SecondPageFragment.newInstance Second Page FRAGMENT public static class SecondPageFragment extends Fragment public static SecondPageFragment newInstance SecondPageFragment..
How to add a Dropdown item on the action bar http://stackoverflow.com/questions/8312344/how-to-add-a-dropdown-item-on-the-action-bar menuSortNewest android title Sort by newest item android id @ id menuSortRating android title Sort by rating menu item Second option menu options.xml menu xmlns android http schemas.android.com apk res android item android id @ id menuSort android..
Store Android SQLite http://stackoverflow.com/questions/9140952/store-android-sqlite more than enough then your device's perfomance will be down. So Internal Memory is best till medium level database. Second Suggestion External Memory SD Card When you are storing database in external Memory like SD Card then for perfomance application..
|