stackoverflow_id
int32
582k
45.8M
question
stringlengths
20
106
question_url
stringlengths
63
132
question_author
stringlengths
3
25
question_author_url
stringlengths
3
65
answer
stringlengths
39
547
answer_url
stringlengths
35
36
answer_author
stringlengths
3
29
answer_author_url
stringlengths
3
84
examples
sequence
examples_url
sequence
1,109,022
Close/hide the Android Soft Keyboard
https://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard
Vidar Vestnes
https://stackoverflow.com/users/133858
// Check if no view has focus: View view = this.getCurrentFocus(); if (view != null) { InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0);}
https://stackoverflow.com/a/1109108
Reto Meier
https://stackoverflow.com/users/822
[ 1841045, 1800067, 1271795 ]
[ "https://github.com/alextselegidis/easyappointments-android-client/blob/39f1e8763eb80e8ca97e070b0e9333c1cd386d90/app/src/main/java/com/easyappointments/LoginActivity.java#L102-L106", "https://github.com/zelloptt/zello-android-client-sdk/blob/87b45b63fbfe05147dab997d69c6ce468cea1101/zello-sdk-sample-misc/src/main/java/com/zello/sdk/sample/misc/MiscActivity.java#L345-L351", "https://github.com/systers/conference-android/blob/a67982abf54e02c4d24ba8368bc907f8cba4e4e2/app/src/main/java/com/systers/conference/profile/EditProfileActivity.java#L513-L519" ]
4,616,095
How to get the build/version number of your Android application?
https://stackoverflow.com/questions/4616095/how-to-get-the-build-version-number-of-your-android-application
Fahad Ali Shaikh
https://stackoverflow.com/users/565591/fahad-ali-shaikh
try { PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0); String version = pInfo.versionName; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); }
https://stackoverflow.com/a/6593822
plus-
https://stackoverflow.com/users/709635/plus
[ 4130029, 3398176, 2320640 ]
[ "https://github.com/altanizio/Conceitos-de-Topografia/blob/24a0d3fed7f7bcc6fb5286b575488524b2961556/MainActivity.java#L167-L176", "https://github.com/mainu4u/MainuApp/blob/eb14d9ff188e77e6d152d563b9a7ec275421ea12/app/src/main/java/eus/mainu/mainu/Activity_Info.java#L15-L30", "https://github.com/opensensorhub/osh-android/blob/4ffe776ddf6228c41c2201bc53cbd801217db4dc/sensorhub-android-app/src/org/sensorhub/android/MainActivity.java#L345-L366" ]
3,004,515
Sending an Intent to browser to open specific URL
https://stackoverflow.com/questions/3004515/sending-an-intent-to-browser-to-open-specific-url
poeschlorn
https://stackoverflow.com/users/317301/poeschlorn
String url = "http://www.example.com"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i);
https://stackoverflow.com/a/3004542
aioobe
https://stackoverflow.com/users/276052/aioobe
[ 3475111, 3477529, 945579 ]
[ "https://github.com/zhouzejin/MvvmBilibili/blob/f0a3bca6823d0a826ca10fcb9162f134f48521d4/app/src/main/java/com/sunny/mvvmbilibili/ui/browser/BrowserActivity.java#L225-L229", "https://github.com/yairigal/MazakApp/blob/a8988b2daf715bd8ce5fbce942a7537266337b4c/app/src/main/java/project/android/com/mazak/Controller/Login/LoginActivity.java#L229-L233", "https://github.com/thiagokimo/TMDb/blob/1888336c23f3243486747002e04bc40a96e09939/presentation/src/main/java/io/kimo/tmdb/presentation/ui/fragment/MovieDetailFragment.java#L204-L208" ]
1,560,788
How to check internet access on Android? InetAddress never times out
https://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-times-out
Vidar Vestnes
https://stackoverflow.com/users/133858/vidar-vestnes
public boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); return netInfo != null && netInfo.isConnectedOrConnecting(); }
https://stackoverflow.com/a/2001824
Eddie
https://stackoverflow.com/users/82880/eddie
[ 4632927, 3439641, 2833060 ]
[ "https://github.com/willemw12/download-link-android/blob/982b2d4054c2dcd12d1f0aeba83bf9396c8a2989/app/src/main/java/willemw12/downloadlink/activity/MainActivity.java#L962-L966", "https://github.com/twishasaraiya/Fitness_App/blob/ccc81326a05d8a7e5d1f2665cadec5a909ccf20f/app/src/main/java/com/example/FirstApp2/SignupActivity.java#L86-L90", "https://github.com/thedevelopersanjeev/NewsApp/blob/084188b82682d9982c35f4d46bf9063b7bf86fba/app/src/main/java/com/example/sanjeev/newsapp/MainActivity.java#L177-L181" ]
3,423,754
Retrieving Android API version programmatically
https://stackoverflow.com/questions/3423754/retrieving-android-api-version-programmatically
Parth Mehta
https://stackoverflow.com/users/402274/parth-mehta
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ // Do something for lollipop and above versions } else{ // do something for phones running an SDK before lollipop }
https://stackoverflow.com/a/3940823
ol_v_er
https://stackoverflow.com/users/384483/ol-v-er
[ 3833176, 1753417, 737342 ]
[ "https://github.com/prabowomurti/tazkiyah-pos-android/blob/dc5f72a7643e73f1b85801088b9821907c5bfa41/src/main/java/net/google/zxing/client/android/InactivityTimer.java#L49-L53", "https://github.com/tiagohs/PopMovies/blob/ff831d9bd5b97210254aa48639207f506e116319/app/src/main/java/br/com/tiagohs/popmovies/util/LocaleUtils.java#L15-L20", "https://github.com/kontalk/androidclient/blob/125459da487f7aa332c2bae146b825ecb9c51565/app/src/main/java/org/kontalk/service/msgcenter/SQLiteRosterStore.java#L324-L329" ]
1,397,361
How do I restart an Android Activity
https://stackoverflow.com/questions/1397361/how-do-i-restart-an-android-activity
N J
https://stackoverflow.com/users/4626831/n-j
Intent intent = getIntent(); finish(); startActivity(intent);
https://stackoverflow.com/a/3974828
EboMike
https://stackoverflow.com/users/345717/ebomike
[ 4642069, 3353864, 2267915 ]
[ "https://github.com/otaviotarelhodb/Tempus/blob/9a39b0f1e1fa292a83066e317c67c5bb107708ea/app/src/main/java/com/tempus/MainActivity.java#L74-L78", "https://github.com/onero/LoginBuster/blob/cd97cffd7d5d005dc5c80260c7fb1cbb8010aaaa/app/src/main/java/dk/adamino/loginbuster/MainActivity.java#L103-L107", "https://github.com/oiricaud/Inventory/blob/8f27c90d98ba62ef9a1ecdc19bfef6ca3cb4fa72/app/src/main/java/activity/MainActivity.java#L2183-L2187" ]
5,015,094
How to determine device screen size category (small, normal, large, xlarge) using code?
https://stackoverflow.com/questions/5015094/how-to-determine-device-screen-size-category-small-normal-large-xlarge-usin
vieux
https://stackoverflow.com/users/404289/vieux
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) { // on a large screen device ... }
https://stackoverflow.com/a/5016350
Jeff Gilfelt
https://stackoverflow.com/users/235945/jeff-gilfelt
[ 2894026, 1923344, 1815886 ]
[ "https://github.com/skyleet/Android-Projects/blob/2cc574e85323ad00fe6ee0bd5475429c4ae12ea5/simplenote-android-develop/Simplenote/src/main/java/com/automattic/simplenote/utils/DisplayUtils.java#L33-L36", "https://github.com/yihaoBeta/ErrorWatcher/blob/49a5562f1a99907463f8018adbc23bb067ca7acf/errorwatcher/src/main/java/com/android/zxs/errorwatcher/Utils.java#L46-L50", "https://github.com/soeminnminn/StaticWallpaper/blob/b9b78f21b534fd562d8181b9f4296fce864d4da8/src/com/s16/staticwallpaper/utils/SystemUtils.java#L21-L25" ]
2,695,746
How to get a list of installed android applications and pick one to run
https://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run
2Real
https://stackoverflow.com/users/306410/2real
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); List<ResolveInfo> pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
https://stackoverflow.com/a/2696617
Karan
https://stackoverflow.com/users/288515/karan
[ 3229066, 615571, 616198 ]
[ "https://github.com/C-vind/GridSwipe_Launcher/blob/0221426e4114702f062e2a59a757e4317276ed82/app/src/main/java/com/github/gridswipe_launcher/PagerAdapter.java#L52-L57", "https://github.com/yuliskov/SmartYouTubeTV/blob/9df75f6df6a341162a9fb4c9d9eb2d30615741e0/smartyoutubetv/src/main/java/com/liskovsoft/smartyoutubetv/misc/LangUpdater.java#L96-L105", "https://github.com/yuliskov/LeanKeyKeyboard/blob/6a8b9c63e5242f78afa22afc9f1b2afa013bc226/leankeykeyboard/src/main/java/com/liskovsoft/utils/LangUpdater.java#L93-L102" ]
3,407,256
Height of status bar in Android
https://stackoverflow.com/questions/3407256/height-of-status-bar-in-android
hpique
https://stackoverflow.com/users/143378/hpique
public int getStatusBarHeight() { int result = 0; int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = getResources().getDimensionPixelSize(resourceId); } return result; }
https://stackoverflow.com/a/14213035
Ben Clayton
https://stackoverflow.com/users/228109/ben-clayton
[ 1393285, 2297206, 2677506 ]
[ "https://github.com/zendesk/belvedere/blob/4bc9457d68acefb4795a93014824a6d2b04d5c03/belvedere/src/main/java/zendesk/belvedere/KeyboardHelper.java#L107-L110", "https://github.com/triline3/timecat/blob/fdb54695c417366ca2c5e0978bae4ef856f74b74/app/src/main/java/com/time/cat/ui/modules/copy/CopyActivity.java#L198-L201", "https://github.com/cdeange/uwaterloo-api/blob/4306a8521ea0f2e30b2876a2c939fa430320d630/sample/src/main/java/com/deange/uwaterlooapi/sample/ui/modules/weather/WeatherFragment.java#L504-L508" ]
4,275,678
How to make a phone call using intent in Android?
https://stackoverflow.com/questions/4275678/how-to-make-a-phone-call-using-intent-in-android
UMAR
https://stackoverflow.com/users/249991/umar
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "Your Phone_number")); startActivity(intent);
https://stackoverflow.com/a/18973484
Denny Sharma
https://stackoverflow.com/users/2756297/denny-sharma
[ 2614525, 2614453, 2614411 ]
[ "https://github.com/miltonbd/MobiGuard/blob/db18f996e3e0f4981cbf19e6c0d0737898f4bd8d/app/src/main/java/com/callsms/sms/BlockedSMSFragment.java#L127-L130", "https://github.com/miltonbd/MobiGuard/blob/db18f996e3e0f4981cbf19e6c0d0737898f4bd8d/app/src/main/java/com/callsms/calls/BlockedNumberFragment.java#L209-L212", "https://github.com/miltonbd/MobiGuard/blob/db18f996e3e0f4981cbf19e6c0d0737898f4bd8d/app/src/main/java/com/callsms/calls/BlockedCallsFragment.java#L115-L118" ]
7,165,830
What is the size of ActionBar in pixels?
https://stackoverflow.com/questions/7165830/what-is-the-size-of-actionbar-in-pixels
Eugene
https://stackoverflow.com/users/397991/eugene
final TypedArray styledAttributes = getContext().getTheme().obtainStyledAttributes( new int[] { android.R.attr.actionBarSize }); mActionBarSize = (int) styledAttributes.getDimension(0, 0); styledAttributes.recycle();
https://stackoverflow.com/a/7167086
AZ13
https://stackoverflow.com/users/815389/az13
[ 1940351, 3039809, 4367576 ]
[ "https://github.com/mozilla/Jisort/blob/4764fe651ec08b786fcfb7d09f063326635fa267/app/src/main/java/com/mozilla/hackathon/kiboko/fragments/ScreenSlidePageFragment.java#L65-L77", "https://github.com/iamprb/MVVM3/blob/1e9a5eca27b17613cd28bdf31fcdb26373bfb82c/app/src/main/java/com/thoughtbeats/pranay/mvvm/base/fragment/AbstractBaseDialogDataBindingFragment.java#L72-L79", "https://github.com/JMedinilla/Netbour/blob/8f5f426c5017175e1cd9cc5a4bd67394764e3c76/app/src/main/java/jvm/ncatz/netbour/pck_fragment/home/all/FrgDocument.java#L263-L309" ]
2,378,800
Clicking URLs opens default browser
https://stackoverflow.com/questions/2378800/clicking-urls-opens-default-browser
JaVadid
https://stackoverflow.com/users/238071/javadid
private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }
https://stackoverflow.com/a/2379054
Dave Webb
https://stackoverflow.com/users/3171/dave-webb
[ 4633934, 2631230, 3550830 ]
[ "https://github.com/tonytran1/WebView-Template/blob/d0319a8cacc3ab54a4f3e3bebb880b429ad49148/app/src/main/java/web/webapp/WebActivity.java#L71-L79", "https://github.com/b2stry/milu-tv/blob/7f9886cfb1f9a06ac3079d41a2cab21efc762ce9/app/src/main/java/com/shallowan/milutv/webview/WebViewActivity.java#L50-L59", "https://github.com/YoungBear/Hello/blob/6a79c35f7863a67aa2c114a4e4758193d47c1083/app/src/main/java/com/example/hello/activity/WebViewActivity.java#L28-L37" ]
3,226,495
How to exit from the application and show the home screen?
https://stackoverflow.com/questions/3226495/how-to-exit-from-the-application-and-show-the-home-screen
poojan9118
https://stackoverflow.com/users/379749/poojan9118
Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);
https://stackoverflow.com/a/3226743
ognian
https://stackoverflow.com/users/2504283/ognian
[ 4287899, 1326758, 3417612 ]
[ "https://github.com/zhangzhichaolove/BaseUtil/blob/82bfaeb94a222a5bb87cbe219e40b5e14ecf6aa8/baselib/src/main/java/com/chao/baselib/util/WindowUtils.java#L174-L179", "https://github.com/whsgzcy/DEMOS_TO_MySelf_Android/blob/d3e3d13efe8e55d4e69da2a006067fb1aa608fbd/app/src/main/java/com/example/super_yu/myexample/daemon/OnePxMain2Activity.java#L47-L52", "https://github.com/vmsoni/Lifes-Game/blob/46caee3bd2687436ef2b8c8e24af603a416ec89c/app/src/main/java/lifesgame/tapstudios/ca/lifesgame/activity/MainActivity.java#L93-L98" ]
9,627,774
Android: allow portrait and landscape for tablets, but force portrait on phone?
https://stackoverflow.com/questions/9627774/android-allow-portrait-and-landscape-for-tablets-but-force-portrait-on-phone/9629127
Kenny Wyland
https://stackoverflow.com/users/416631/kenny-wyland
if(getResources().getBoolean(R.bool.portrait_only)){ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
https://stackoverflow.com/a/14793611
Brian Christensen
https://stackoverflow.com/users/649181/brian-christensen
[ 1042654, 3300538, 1042952 ]
[ "https://github.com/openfoodfacts/openfoodfacts-androidapp/blob/fa961caa06253f722c7127099e660ce00559250d/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/BaseActivity.java#L25-L32", "https://github.com/VladimirMi/LocalRadio/blob/e97f91d697035824be8d27a2308554e004e3117d/app/src/main/java/io/github/vladimirmi/localradio/presentation/main/MainActivity.java#L58-L67", "https://github.com/openfoodfacts/openfoodfacts-androidapp/blob/fa961caa06253f722c7127099e660ce00559250d/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/splash/SplashActivity.java#L42-L55" ]
3,918,517
Calling startActivity() from outside of an Activity?
https://stackoverflow.com/questions/3918517/calling-startactivity-from-outside-of-an-activity-context
Sako73
https://stackoverflow.com/users/226376/sako73
Intent i = new Intent(this, Wakeup.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
https://stackoverflow.com/a/3918838
Alex Volovoy
https://stackoverflow.com/users/176761/alex-volovoy
[ 1879264, 802386, 1090670 ]
[ "https://github.com/suyimin/unicorn/blob/713337b95338ae868e13bf711879429e009dd032/sdk/src/main/java/com/xdroid/util/IntentUtils.java#L171-L174", "https://github.com/saket/Better-Link-Movement-Method/blob/23f4448cf891fedf1efa610271e2323461af97b3/sample/src/main/java/me/saket/bettermovementmethod/sample/PhoneLinkPopupMenu.java#L43-L46", "https://github.com/miaoyongjun/AUtils/blob/2f509ffbef7b3f2f27f095496567642fca620972/library/src/main/java/miaoyongjun/autil/utils/IntentUtils.java#L173-L176" ]
12,301,510
How to get the ActionBar height?
https://stackoverflow.com/questions/12301510/how-to-get-the-actionbar-height
znat
https://stackoverflow.com/users/990616/znat
// Calculate ActionBar height TypedValue tv = new TypedValue(); if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics()); }
https://stackoverflow.com/a/13216807
Anthony
https://stackoverflow.com/users/650322/anthony
[ 2356877, 2893009, 1173041 ]
[ "https://github.com/st235/Yandex.Weather/blob/951569136d0e79ca105779825fcbcd77b72b0526/app/src/main/java/suhockii/dev/weather/presentation/drawer/DrawerFragment.java#L103-L109", "https://github.com/skyleet/Android-Projects/blob/2cc574e85323ad00fe6ee0bd5475429c4ae12ea5/my-resume-master/app/src/main/java/io/github/fadils/myresume/MainActivity.java#L183-L190", "https://github.com/IhorKlimov/Android-Animations/blob/65afdc3a4623af2eba326160998bf257624102b5/app/src/main/java/com/myhexaville/iconanimations/MainActivity.java#L214-L221" ]
11,120,392
Android Center text on canvas
https://stackoverflow.com/questions/11120392/android-center-text-on-canvas
Sebastian
https://stackoverflow.com/users/1469324/sebastian
int xPos = (canvas.getWidth() / 2); int yPos = (int) ((canvas.getHeight() / 2) - ((textPaint.descent() + textPaint.ascent()) / 2)) ; //((textPaint.descent() + textPaint.ascent()) / 2) is the distance from the baseline to the center. canvas.drawText("Hello", xPos, yPos, textPaint);
https://stackoverflow.com/a/11121873
Arun George
https://stackoverflow.com/users/1428555/arun-george
[ 3610256, 3209066, 4686559 ]
[ "https://github.com/zhangxyfs/Android_Pack_MVP/blob/ff382099cb1604d6fbc8606149340b2d80c199c4/Base/src/main/java/com/z7dream/apm/base/widget/draggabledot/DotView.java#L149-L158", "https://github.com/vlad-senyuk-1997/Turnaround-Medicine/blob/37367e5f99b2904fa9c75f326474c398701e2215/Android-Client/app/src/main/java/com/example/user/dipl1/security/Security.java#L112-L124", "https://github.com/aman400/CircularProgress/blob/b75ddf965b357f90e39fb5a8e2504f588792d111/library/src/main/java/com/aman/circularprogress/CircularProgress.java#L366-L379" ]
26,858,692
SwipeRefreshLayout setRefreshing() not showing indicator initially
https://stackoverflow.com/questions/26858692/swiperefreshlayout-setrefreshing-not-showing-indicator-initially
thunderousNinja
https://stackoverflow.com/users/684948/thunderousninja
mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { mSwipeRefreshLayout.setRefreshing(true); } });
https://stackoverflow.com/a/26910973
Volodymyr Baydalka
https://stackoverflow.com/users/4248565/volodymyr-baydalka
[ 1756695, 4306656, 4306605 ]
[ "https://github.com/lethalskillzz/Blockbusters/blob/8b4175b9f4d7a2f3276967c74ef044eedf88bc57/app/src/main/java/com/lethalskillzz/blockbusters/blockbusters/presentation/Discovery/DiscoveryActivity.java#L158-L164", "https://github.com/yeshuwei/WuLiao/blob/3566a586fc5b7c22a928ba83c7f09faff5da1215/app/src/main/java/com/wuliao/mvp/one/OneFragment.java#L101-L108", "https://github.com/yeshuwei/WuLiao/blob/3566a586fc5b7c22a928ba83c7f09faff5da1215/app/src/main/java/com/wuliao/mvp/detail/url/WebFragment.java#L198-L205" ]
2,492,076
Android Reading from an Input stream efficiently
https://stackoverflow.com/questions/2492076/android-reading-from-an-input-stream-efficiently
RenegadeAndy
https://stackoverflow.com/users/265683/renegadeandy
BufferedReader r = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder total = new StringBuilder(); String line; while ((line = r.readLine()) != null) { total.append(line).append('\n'); }
https://stackoverflow.com/a/2549222
Jaime Soriano
https://stackoverflow.com/users/28855/jaime-soriano
[ 48803, 356859, 645286 ]
[ "https://github.com/alibaba/atlas/blob/169e68f08e2b1687e6ddfca81c183d847a5d395a/atlas-gradle-plugin/dexpatch/src/main/java/com/taobao/android/tools/HotPatchTool.java#L90-L96", "https://github.com/web3j/web3j/blob/4f6fc562edcef9d603a937a5b622d91faf2c5ad7/crypto/src/main/java/org/web3j/crypto/MnemonicUtils.java#L263-L270", "https://github.com/tony19/logback-android/blob/2eb933c9bc345f0874b0231362adedb5aaa9929f/logback-android/src/test/java/ch/qos/logback/core/testUtil/FileToBufferUtil.java#L50-L57" ]
6,526,874
Call removeView() on the child's parent first
https://stackoverflow.com/questions/6526874/call-removeview-on-the-childs-parent-first
kasgoku
https://stackoverflow.com/users/473831/kasgoku
((ViewGroup)scrollChildLayout.getParent()).removeView(scrollChildLayout); //scrollView.removeView(scrollChildLayout);
https://stackoverflow.com/a/6538694
kasgoku
https://stackoverflow.com/users/473831/kasgoku
[ 1609079, 3678516, 51755 ]
[ "https://github.com/kevinwang5658/backstack/blob/2f65cd95de7f5530bb48cfd83abab6eb8697847a/library/src/main/java/com/rievo/library/LinearBackStack.java#L112-L114", "https://github.com/inpratik13/android-utils/blob/4bac9e23d232f762ae5a19bdd7098d43ae7b7cf8/src/main/java/com/vyantech/androidutils/animation/support/RemoveOnAnimationComplete.java#L24-L26", "https://github.com/alibaba/Virtualview-Android/blob/5fb7621eeb57dddf49233bb4cfa385d0b0e9672b/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/view/scroller/ScrollerImp.java#L288-L290" ]
4,943,629
How to delete a whole folder and content?
https://stackoverflow.com/questions/4943629/how-to-delete-a-whole-folder-and-content
Beginner
https://stackoverflow.com/users/569654/beginner
void deleteRecursive(File fileOrDirectory) { if (fileOrDirectory.isDirectory()) for (File child : fileOrDirectory.listFiles()) deleteRecursive(child); fileOrDirectory.delete(); }
https://stackoverflow.com/a/6425744
teedyay
https://stackoverflow.com/users/15825/teedyay
[ 1510844, 3734555, 2722527 ]
[ "https://github.com/nicolas-raoul/OxygenGuide-Android/blob/b35faf1f1839b4de852408e6ead5ec199639e7bb/src/org/github/OxygenGuide/MainActivity.java#L107-L112", "https://github.com/lulululbj/android-6.0.1_r72_source/blob/078f97ce084e3a1f06c67ce47bd7ad3bdf43cb06/frameworks/base/services/core/java/com/android/server/updates/SELinuxPolicyInstallReceiver.java#L77-L82", "https://github.com/henryco/OPalette/blob/6ad35d62440deda9bd360b36cb1613a93d89c652/app/src/main/java/net/henryco/opalette/api/utils/Utils.java#L270-L275" ]
9,494,037
How to set text size of textview dynamically for different screens
https://stackoverflow.com/questions/9494037/how-to-set-text-size-of-textview-dynamically-for-different-screens
Nishant
https://stackoverflow.com/users/829188/nishant
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.textsize));
https://stackoverflow.com/a/14410438
Justin Mclean
https://stackoverflow.com/users/1971798/justin-mclean
[ 2532416, 236661, 4584016 ]
[ "https://github.com/santiago-hollmann/igcparser/blob/e970b18fea22738c515d9b49321db6064b8063e3/app/src/main/java/com/shollmann/igcparser/ui/activity/FlightInformationActivity.java#L249-L256", "https://github.com/TeamNewPipe/NewPipe/blob/5c32d73409cff3387cf2baefa498f9c064a2eae8/app/src/main/java/org/schabi/newpipe/util/FilePickerActivityHelper.java#L89-L98", "https://github.com/shubhamiiest/Android/blob/d60b1f7eab2bff0bb6ca1b370bef99f1c0b7d4cd/Iiest_shibpur/facebook/src/com/facebook/widget/LikeView.java#L457-L470" ]
9,822,076
How do I prevent Android taking a screenshot when my app goes to the background?
https://stackoverflow.com/questions/9822076/how-do-i-prevent-android-taking-a-screenshot-when-my-app-goes-to-the-background
StingRay5
https://stackoverflow.com/users/718504/stingray5
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); }
https://stackoverflow.com/a/11121897
gardarh
https://stackoverflow.com/users/426213/gardarh
[ 2530355, 414449, 2981573 ]
[ "https://github.com/NikhilBorad/BaseHelp/blob/7b1d5c06bbfa8fcc39c6b2f38a337e155088462b/baselibrary/src/main/java/com/share/baselibrary/BaseAppCompactActivity.java#L985-L987", "https://github.com/commonsguy/cwac-security/blob/d7f4b9a3be22f8dcb073c4cfb32ecc88c6249327/security/src/main/java/com/commonsware/cwac/security/flagsecure/FlagSecureHelper.java#L65-L70", "https://github.com/alexxxdev/platform_packages_apps_Settings/blob/97752e6a5f7766824bae865f4056cc7f503a2a16/src/com/android/settings/deviceinfo/SimStatus.java#L190-L195" ]
8,276,634
Android get hosting Activity from a view
https://stackoverflow.com/questions/8276634/how-to-get-hosting-activity-from-a-view
mAndroid
https://stackoverflow.com/users/917580/mandroid
private Activity getActivity() { Context context = getContext(); while (context instanceof ContextWrapper) { if (context instanceof Activity) { return (Activity)context; } context = ((ContextWrapper)context).getBaseContext(); } return null; }
https://stackoverflow.com/a/32973351
Gomino
https://stackoverflow.com/users/795245/gomino
[ 3399554, 4529628, 4529608 ]
[ "https://github.com/jngoogle/Keionbu/blob/ec0f93b6fc974d6a95825e80911f2538e649ec3c/app/src/main/java/com/example/jngoogle/keionbu/util/ActivitiesUtil.java#L14-L23", "https://github.com/hasanmumin/EasyForm/blob/170804bfea6f6e2e37c75df20e88a6011c43577d/library/src/main/java/com/easyform/library/editors/PhotoElement.java#L85-L94", "https://github.com/hasanmumin/EasyForm/blob/170804bfea6f6e2e37c75df20e88a6011c43577d/library/src/main/java/com/easyform/library/editors/DateTimeElement.java#L96-L105" ]
5,382,490
How to add a line break in an Android TextView?
https://stackoverflow.com/questions/5382490/how-to-add-a-line-break-in-an-android-textview
dropsOfJupiter
https://stackoverflow.com/users/538428/dropsofjupiter
String s = "Line 1" + System.getProperty ("line.separator") + "Line 2" + System.getProperty ("line.separator");
https://stackoverflow.com/a/10566210
Eric JOYÉ
https://stackoverflow.com/users/1091773/eric-joy%c3%89
[ 1912566, 2451432, 2329747 ]
[ "https://github.com/kaltura/playkit-android/blob/d053067a2f27cb169148e86811fe59c93d2ff2e3/playkit/src/main/java/com/kaltura/playkit/PlaybackInfo.java#L73-L80", "https://github.com/wqqgt/chromiumforandroid/blob/81fdcd15c4cbb384c3a00f81d9c2359dc82aa07f/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java#L200-L209", "https://github.com/rafaelaaraujo/Face-detect-framework/blob/839db10e53a8f32ab1cc42e4c7f798b35718f77b/app/src/main/java/com/derzapp/myfacedetection/FisherFaceRecognizer.java#L85-L99" ]
3,080,402
Android: ScrollView force to bottom
https://stackoverflow.com/questions/3080402/android-scrollview-force-to-bottom
Noah Seidman
https://stackoverflow.com/users/371532/noah-seidman
scroll.post(new Runnable() { @Override public void run() { scroll.fullScroll(View.FOCUS_DOWN); } });
https://stackoverflow.com/a/4524131
hungson175
https://stackoverflow.com/users/424721/hungson175
[ 4702438, 3408653, 2869470 ]
[ "https://github.com/clapas/kaizen-android-client/blob/9042aa30888e3bd2690d829b7723582bd141d089/src/com/pyco/appkaizen/DetailActivity.java#L39-L47", "https://github.com/14chanwa/gestionnaireDeSporz/blob/286e38d849e636be64d9c305001a6c909801e4e9/app/src/main/java/com/minastelien/quentin/gestionnairedesporz/Fragments/Fragment_game_hist.java#L65-L73", "https://github.com/tplloi/basemaster/blob/7eaf44d0a37e603296995566f6ec6a3b8569f1e4/app/src/main/java/vn/loitp/app/activity/demo/film/FilmDemoActivity.java#L195-L204" ]
3,553,779
Android dismiss keyboard
https://stackoverflow.com/questions/3553779/android-dismiss-keyboard/3553966
Manikandan
https://stackoverflow.com/users/454665/manikandan
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
https://stackoverflow.com/a/3553811
DeRagan
https://stackoverflow.com/users/302328/deragan
[ 3079130, 4265101, 4224060 ]
[ "https://github.com/ypdieguez/CursorRecyclerAdapter/blob/31a0ed17ba92536b688e28150ecffb110e416f29/sample_app/src/main/java/io/github/ypdieguez/sample_app/cursorrecycleradapter/MainActivity.java#L168-L171", "https://github.com/thebestory/android/blob/8f8208a98b61bf0b06d048d70125c3831ac51b53/app/src/main/java/com/thebestory/android/activity/MainActivity.java#L164-L167", "https://github.com/summer88123/Bnade/blob/7864874c1e66cc395fdc92d7a97f7d42b3bc8b49/app/src/main/java/com/summer/bnade/home/MainActivity.java#L167-L170" ]
14,074,129
Google Maps v2 - set both my location and zoom in
https://stackoverflow.com/questions/14074129/google-maps-v2-set-both-my-location-and-zoom-in
Dustin
https://stackoverflow.com/users/1916688/dustin
CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom);
https://stackoverflow.com/a/14074953
CommonsWare
https://stackoverflow.com/users/115145/commonsware
[ 4562534, 411958, 411924 ]
[ "https://github.com/angelospanag/gaia-alert-android/blob/e1fb02db056644009d3bb908246b5174499120a7/app/src/main/java/com/angelospanag/android/gaiaalert/MapFragment.java#L100-L106", "https://github.com/commonsguy/cw-omnibus/blob/f28ad7cc5774e08f0c4a62c76a03557987961bed/MapsV2/NooYawk/app/src/main/java/com/commonsware/android/mapsv2/nooyawk/MainActivity.java#L44-L52", "https://github.com/commonsguy/cw-omnibus/blob/f28ad7cc5774e08f0c4a62c76a03557987961bed/MapsV2/Models/app/src/main/java/com/commonsware/android/mapsv2/model/MainActivity.java#L54-L70" ]
8,348,707
Prevent ViewPager from destroying off-screen views
https://stackoverflow.com/questions/8348707/prevent-viewpager-from-destroying-off-screen-views
chefgon
https://stackoverflow.com/users/319506/chefgon
mViewPager = (ViewPager)findViewById(R.id.pager); mViewPager.setOffscreenPageLimit(2);
https://stackoverflow.com/a/8349004
David Snabel-Caunt
https://stackoverflow.com/users/80425/david-snabel-caunt
[ 4638517, 4561945, 338569 ]
[ "https://github.com/kndtime/windshot/blob/4b09823b14206b65c2d5c8edec05e40ab3576fa4/app/src/main/java/com/app/windchat/ui/activity/MainActivity.java#L43-L49", "https://github.com/unQualsevol/popularMovies1/blob/a19ef29ebe58c8dbf3f320286c41f35da7c817e7/app/src/main/java/com/unqualsevol/moviesproject1/MainActivity.java#L16-L25", "https://github.com/stfalcon-studio/ChatKit/blob/1c17fcc2e9ccf6ed7a3cd4c03f79d0c226b8adb9/sample/src/main/java/com/stfalcon/chatkit/sample/features/main/MainActivity.java#L25-L37" ]
5,099,550
How to check an Android device is HDPI screen or MDPI screen?
https://stackoverflow.com/questions/5099550/how-to-check-an-android-device-is-hdpi-screen-or-mdpi-screen
virsir
https://stackoverflow.com/users/238061/virsir
density = getResources().getDisplayMetrics().density; // return 0.75 if it's LDPI // return 1.0 if it's MDPI // return 1.5 if it's HDPI // return 2.0 if it's XHDPI // return 3.0 if it's XXHDPI // return 4.0 if it's XXXHDPI
https://stackoverflow.com/a/5099588
SteD
https://stackoverflow.com/users/71724/sted
[ 1299818, 729006, 272122 ]
[ "https://github.com/TongmingWu/Manga/blob/42b614073fe33cd7092a6062cc98e8123ec1f384/app/src/main/java/com/tongming/manga/cusview/ScrollSpeedLinearLayoutManger.java#L68-L70", "https://github.com/HabitRPG/habitica-android/blob/5cd2177c0ea579376f685ebb091bdf9668e54ad6/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/HabiticaIconsHelper.java#L20-L22", "https://github.com/zzhoujay/RichText/blob/bd086aac94a8c84ee27914b4a0695fcb4c55e5a6/app/src/main/java/zhou/demo/MainActivity.java#L207-L210" ]
2,848,575
How to detect UI thread on Android?
https://stackoverflow.com/questions/2848575/how-to-detect-ui-thread-on-android
ParDroid
https://stackoverflow.com/users/289566/pardroid
if (Looper.getMainLooper().getThread() == Thread.currentThread()) { // On UI thread. } else { // Not on UI thread. }
https://stackoverflow.com/a/7897562
mik3y
https://stackoverflow.com/users/642485/mik3y
[ 2389089, 2377552, 1516958 ]
[ "https://github.com/ZoranLi/wechat_reversing/blob/36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a/com/tencent/mm/plugin/game/gamewebview/ui/d.java#L1171-L1177", "https://github.com/ZoranLi/wechat_reversing/blob/36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a/com/tencent/mm/plugin/appbrand/g/j.java#L190-L196", "https://github.com/RooyeKhat-Media/iGap-Android/blob/8e66515f507010e05ad20cd2d2585bb4ebc29dff/app/src/main/java/net/iGap/fragments/FragmentChat.java#L581-L587" ]
2,618,182
How to play ringtone/alarm sound in Android
https://stackoverflow.com/questions/2618182/how-to-play-ringtone-alarm-sound-in-android
Federico
https://stackoverflow.com/users/314029/federico
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification); r.play();
https://stackoverflow.com/a/8568304
markov00
https://stackoverflow.com/users/408727/markov00
[ 3275569, 4489005, 2592472 ]
[ "https://github.com/alessandror/AndroidFallDetectionApp/blob/ff4ccf0b92a4de1fa4795fde0c86431033c70544/FallDetection/app/src/main/java/com/alexr/falldetection/MainActivity.java#L176-L180", "https://github.com/junzew/pomodoro/blob/a0a98f6729c2675c9a4fdf1dcd6e36e030432faa/app/src/main/java/com/junzew/pomodoro/ClockService.java#L111-L118", "https://github.com/bulentsiyah/Android--Barcode--Okuma--ve--Mobil--Cihazda--Olusturma/blob/b1b90d8feacff3e9e0345226ae0ca13108e662a6/app/src/main/java/com/bulentsiyah/androidbarcodeokumaveolusturma/SimpleScannerActivity.java#L146-L153" ]
3,990,110
How to show marker in Maps launched by geo uri Intent?
https://stackoverflow.com/questions/3990110/how-to-show-marker-in-maps-launched-by-geo-uri-intent
Specur
https://stackoverflow.com/users/336525/specur
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?q=<lat>,<long>(Label+Name)")); startActivity(intent);
https://stackoverflow.com/a/7405992
Kenton Price
https://stackoverflow.com/users/408227/kenton-price
[ 1205208, 539694, 2322071 ]
[ "https://github.com/vojta-horanek/APKMirror/blob/3facdf93170b86b441869a93b97e103d4e62461a/app/src/main/java/cf/vojtechh/apkmirror/activities/MainActivity.java#L673-L676", "https://github.com/varunest/SparkButton/blob/bdcb29435ea2c307f62122f839d4d7f69b0eb972/app/src/main/java/com/varunest/sample/ScreenSlidePagerAdapter.java#L149-L152", "https://github.com/umair13adil/DirectionMeter/blob/5975dd049f511992698bdd1ae51654824c177010/app/src/main/java/com/blackbox/direction/meter/utils/Utils.java#L469-L472" ]
2,892,615
How to remove auto focus/keyboard popup of a field when the screen shows up?
https://stackoverflow.com/questions/2892615/how-to-remove-auto-focus-keyboard-popup-of-a-field-when-the-screen-shows-up
Pentium10
https://stackoverflow.com/users/243782/pentium10
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);
https://stackoverflow.com/a/6095753
Mitul Nakum
https://stackoverflow.com/users/252037/mitul-nakum
[ 3079130, 4265101, 4224060 ]
[ "https://github.com/ypdieguez/CursorRecyclerAdapter/blob/31a0ed17ba92536b688e28150ecffb110e416f29/sample_app/src/main/java/io/github/ypdieguez/sample_app/cursorrecycleradapter/MainActivity.java#L168-L171", "https://github.com/thebestory/android/blob/8f8208a98b61bf0b06d048d70125c3831ac51b53/app/src/main/java/com/thebestory/android/activity/MainActivity.java#L164-L167", "https://github.com/summer88123/Bnade/blob/7864874c1e66cc395fdc92d7a97f7d42b3bc8b49/app/src/main/java/com/summer/bnade/home/MainActivity.java#L167-L170" ]
5,763,304
Disable ScrollView Programmatically?
https://stackoverflow.com/questions/5763304/disable-scrollview-programmatically
Omar
https://stackoverflow.com/users/668082/omar
scrollView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub return isBlockedScrollView; } });
https://stackoverflow.com/a/15426849
lily
https://stackoverflow.com/users/2172940/lily
[ 2873632, 4333158, 424138 ]
[ "https://github.com/tplloi/basemaster/blob/7eaf44d0a37e603296995566f6ec6a3b8569f1e4/core/src/main/java/vn/loitp/views/placeholderview/lib/placeholderview/SwipeViewBinder.java#L653-L660", "https://github.com/talAriel/tinderForYourPhotos/blob/72f371d5bad077de0dfa63a5ab8e28f444ea7398/App/Industrial_Project/placeholderview/src/main/java/com/mindorks/placeholderview/SwipeViewBinder.java#L637-L644", "https://github.com/janishar/PlaceHolderView/blob/7a4bb8b290ff9ab15c483e0fb1ec1eb7d0f0d508/placeholderview/src/main/java/com/mindorks/placeholderview/SwipeViewBinder.java#L471-L478" ]
4,166,917
Android: How to rotate a bitmap on a center point
https://stackoverflow.com/questions/4166917/android-how-to-rotate-a-bitmap-on-a-center-point
Stefan
https://stackoverflow.com/users/506015/stefan
public static Bitmap RotateBitmap(Bitmap source, float angle) { Matrix matrix = new Matrix(); matrix.postRotate(angle); return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true); }
https://stackoverflow.com/a/16218346
Arvis
https://stackoverflow.com/users/1039935/arvis
[ 4663984, 2293096, 2293095 ]
[ "https://github.com/zmousa/AndroidBackup/blob/f4dd434dea285f8c0d6d62c88db37d71c2e5567a/app/src/main/java/com/zmousa/androidbackup/services/BackupGalleryImagesService.java#L104-L108", "https://github.com/yuyuyu123/ZCommon/blob/60cf14491f4d3a25060b1c3fd52415b115ea6aea/zcommon/src/main/java/com/cc/android/zcommon/utils/android/BitmapUtils.java#L181-L185", "https://github.com/yuyuyu123/ZCommon/blob/60cf14491f4d3a25060b1c3fd52415b115ea6aea/zcommon/src/main/java/com/cc/android/zcommon/utils/android/BitmapUtils.java#L169-L173" ]
4,319,212
How can one detect airplane mode on Android?
https://stackoverflow.com/questions/4319212/how-can-one-detect-airplane-mode-on-android
Sean W.
https://stackoverflow.com/users/501333/sean-w
/** * Gets the state of Airplane Mode. * * @param context * @return true if enabled. */ private static boolean isAirplaneModeOn(Context context) { return Settings.System.getInt(context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0) != 0; }
https://stackoverflow.com/a/4319257
Alex Volovoy
https://stackoverflow.com/users/176761/alex-volovoy
[ 2938107, 2649213, 3970893 ]
[ "https://github.com/dedge-space/assoid/blob/8af7fb4e1abb8a2f6e83f431a9398c8db018ec9b/src/main/java/hobby/wei/c/phone/Network.java#L128-L130", "https://github.com/nearit/Android-UI-Bindings/blob/a2572ee8c72a7002938c5dd67535bc746a216261/nearit-ui/src/main/java/com/nearit/ui_bindings/utils/PermissionsUtils.java#L79-L82", "https://github.com/luki122/iunios/blob/890ae1c11dab2b859abd012abae0807a6b46fa80/Aurora_Weather/code/src/com/aurora/weatherdata/util/SystemUtils.java#L155-L158" ]
5,282,936
Android backup/restore: how to backup an internal database?
https://stackoverflow.com/questions/5282936/android-backup-restore-how-to-backup-an-internal-database
pjv
https://stackoverflow.com/users/458813/pjv
FileBackupHelper hosts = new FileBackupHelper(this, "../databases/" + HostDatabase.DB_NAME); addHelper(HostDatabase.DB_NAME, hosts);
https://stackoverflow.com/a/6332290
pjv
https://stackoverflow.com/users/458813/pjv
[ 506143, 2442000, 1877608 ]
[ "https://github.com/connectbot/connectbot/blob/2453d3ce2291cf27aa42cfb3bf8f73ade5b8e4f5/app/src/main/java/org/connectbot/service/BackupAgent.java#L40-L55", "https://github.com/raphaelm/lendlist/blob/71020019037889219d9c0413de77b7450d9e55e5/app/src/main/java/de/raphaelmichel/lendlist/backup/AndroidBackupAgent.java#L14-L22", "https://github.com/Fondson/Note-Locker/blob/34e298ecf6a74bd55b1b24e6a4bd5b1fae61e24d/app/src/main/java/com/dev/fondson/NoteLocker/TheBackupAgent.java#L22-L30" ]
10,346,011
How to handle Back button with in the dialog?
https://stackoverflow.com/questions/10346011/how-to-handle-back-button-with-in-the-dialog
kiran
https://stackoverflow.com/users/651430/kiran
dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { //do whatever you want the back key to do } });
https://stackoverflow.com/a/10346421
alexc
https://stackoverflow.com/users/1043516/alexc
[ 896267, 942346, 1270292 ]
[ "https://github.com/tranleduy2000/pascalnide/blob/c7f3f79ecf4cf6a81b32c7d389aad7f4034c8f01/app/src/main/java/com/duy/pascal/interperter/libraries/android/view/dialog/AlertDialogTask.java#L291-L299", "https://github.com/acomminos/Plumble/blob/830e21d27c1d51f661e690327c01e8c1a44f180d/app/src/main/java/com/morlunk/mumbleclient/servers/PublicServerListFragment.java#L377-L388", "https://github.com/WhiteDG/BihuDaily/blob/1483810cf27af2e127199567c37bb26250d8341b/app/src/main/java/com/white/bihudaily/base/BaseWithToolbarActivity.java#L56-L67" ]
2,486,934
Programmatically relaunch/recreate an activity?
https://stackoverflow.com/questions/2486934/programmatically-relaunch-recreate-an-activity
Pentium10
https://stackoverflow.com/users/243782/pentium10
Intent intent = getIntent(); finish(); startActivity(intent);
https://stackoverflow.com/a/13145452
Ayush Goyal
https://stackoverflow.com/users/398802/ayush-goyal
[ 4642069, 3353864, 2267915 ]
[ "https://github.com/otaviotarelhodb/Tempus/blob/9a39b0f1e1fa292a83066e317c67c5bb107708ea/app/src/main/java/com/tempus/MainActivity.java#L74-L78", "https://github.com/onero/LoginBuster/blob/cd97cffd7d5d005dc5c80260c7fb1cbb8010aaaa/app/src/main/java/dk/adamino/loginbuster/MainActivity.java#L103-L107", "https://github.com/oiricaud/Inventory/blob/8f27c90d98ba62ef9a1ecdc19bfef6ca3cb4fa72/app/src/main/java/activity/MainActivity.java#L2183-L2187" ]
7,979,440
Android: Cloning a drawable in order to make a StateListDrawable with filters
https://stackoverflow.com/questions/7979440/android-cloning-a-drawable-in-order-to-make-a-statelistdrawable-with-filters
talkol
https://stackoverflow.com/users/1025458/talkol
Drawable clone = drawable.getConstantState().newDrawable();
https://stackoverflow.com/a/7980637
Flavio
https://stackoverflow.com/users/584208/flavio
[ 1687325, 408075, 408076 ]
[ "https://github.com/IdeaTrackerPlus/IdeaTrackerPlus/blob/b035bbd2a0b1bf8510ebdeac9680312fb6e19f7e/app/src/main/java/manparvesh/ideatrackerplus/MainActivity.java#L1212-L1219", "https://github.com/timusus/Shuttle/blob/53f93c7f955edba730bb83a3def6a5f2005c7b9a/app/src/main/java/com/simplecity/amp_library/utils/DrawableUtils.java#L22-L32", "https://github.com/timusus/Shuttle/blob/53f93c7f955edba730bb83a3def6a5f2005c7b9a/app/src/main/java/com/simplecity/amp_library/utils/DrawableUtils.java#L40-L50" ]
7,606,498
End animation event android
https://stackoverflow.com/questions/7606498/end-animation-event-android
Paulo Barros
https://stackoverflow.com/users/469631/paulo-barros
anim.setAnimationListener(new Animation.AnimationListener(){ @Override public void onAnimationStart(Animation arg0) { } @Override public void onAnimationRepeat(Animation arg0) { } @Override public void onAnimationEnd(Animation arg0) { } });
https://stackoverflow.com/a/7606533
blessenm
https://stackoverflow.com/users/548568/blessenm
[ 3074753, 2441593, 1271087 ]
[ "https://github.com/silverchen/fb-audience-network-android-demo-app/blob/ca08aa3d1233e383db2fa9deca8ddd5fc0d36f33/FinestWebView/src/main/java/com/thefinestartist/finestwebview/FinestWebViewActivity.java#L1046-L1060", "https://github.com/Agraphie/MaterialSearchView/blob/461eac607250896f0f160815285f41e1e4e8a61d/library/src/main/java/de/clemenskeppler/materialsearchview/MaterialSearchView.java#L293-L307", "https://github.com/systers/powerup-android/blob/2e226a21b097cb476dd8b22df01510ea4c4cb2a9/PowerUp/app/src/main/java/powerup/systers/com/ui/Level2TransitionActivity.java#L69-L84" ]
3,724,509
Going to home screen programmatically
https://stackoverflow.com/questions/3724509/going-to-home-screen-programmatically
Sri Sri
https://stackoverflow.com/users/399046/sri-sri
Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startMain);
https://stackoverflow.com/a/3725042
Janusz
https://stackoverflow.com/users/114066/janusz
[ 4287899, 1326758, 3417612 ]
[ "https://github.com/zhangzhichaolove/BaseUtil/blob/82bfaeb94a222a5bb87cbe219e40b5e14ecf6aa8/baselib/src/main/java/com/chao/baselib/util/WindowUtils.java#L174-L179", "https://github.com/whsgzcy/DEMOS_TO_MySelf_Android/blob/d3e3d13efe8e55d4e69da2a006067fb1aa608fbd/app/src/main/java/com/example/super_yu/myexample/daemon/OnePxMain2Activity.java#L47-L52", "https://github.com/vmsoni/Lifes-Game/blob/46caee3bd2687436ef2b8c8e24af603a416ec89c/app/src/main/java/lifesgame/tapstudios/ca/lifesgame/activity/MainActivity.java#L93-L98" ]
30,430,664
How to hide "Navigation" and "GPS Pointer" buttons when I click the marker on the android google map
https://stackoverflow.com/questions/30430664/how-to-hide-navigation-and-gps-pointer-buttons-when-i-click-the-marker-on-th
Tim Yu
https://stackoverflow.com/users/4254748/tim-yu
//Disable Map Toolbar: mMap.getUiSettings().setMapToolbarEnabled(false);
https://stackoverflow.com/a/30431024
Daniel Nugent
https://stackoverflow.com/users/4409409/daniel-nugent
[ 4394475, 4548828, 2978755 ]
[ "https://github.com/pbmchc/emzetka/blob/81a475e02b7da61bd26472011760dd633e7a0974/app/src/main/java/com/pbmchc/emzetka/activities/SingleLineMapActivity.java#L114-L120", "https://github.com/jarvislin/Is-it-raining/blob/d56fba7479eb7a3294e41dd6de87d1b7f6a5024b/app/src/main/java/com/jarvislin/isitrainingnow/page/main/MainActivity.java#L85-L91", "https://github.com/alexxxdev/packages_apps_Dialer/blob/16a1917119ec2673c5b5a0796316469486312767/java/com/android/incallui/maps/impl/StaticMapFragment.java#L69-L75" ]
25,216,749
SoftKeyboard open and close listener in an activity in Android?
https://stackoverflow.com/questions/25216749/soft-keyboard-open-and-close-listener-in-an-activity-in-android
N Sharma
https://stackoverflow.com/users/2455259/n-sharma
yourEditText.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { //got focus } else { //lost focus } } });
https://stackoverflow.com/a/25680383
CommonGuy
https://stackoverflow.com/users/2829009/commonguy
[ 4260569, 2451565, 4278748 ]
[ "https://github.com/camandmum22/leishmaniasis-prediction/blob/8039a9c9bff5838bdd10d4c3a6a638c844e80521/app/src/main/java/i2t/cideim/leishmaniasis/CreatePatientActivity.java#L299-L306", "https://github.com/wqqgt/chromiumforandroid/blob/81fdcd15c4cbb384c3a00f81d9c2359dc82aa07f/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java#L1150-L1159", "https://github.com/jensgreiner/ScrumQuiz/blob/828948a0525a0335c14e4ddf3fce1af4699f2744/app/src/main/java/com/greiner_co/scrumquiz/MainActivity.java#L168-L177" ]
32,367,469
Unable to create converter for my class in Android Retrofit library
https://stackoverflow.com/questions/32367469/unable-to-create-converter-for-my-class-in-android-retrofit-library
Earwin delos Santos
https://stackoverflow.com/users/4998335/earwin-delos-santos
Retrofit retrofit = new Retrofit.Builder() .baseUrl("**sample base url here**") .addConverterFactory(GsonConverterFactory.create()) .build();
https://stackoverflow.com/a/32390665
iagreen
https://stackoverflow.com/users/1904517/iagreen
[ 2439984, 2439982, 2866692 ]
[ "https://github.com/KodiMadhavarao/Ipl2018/blob/7e38cccc4420116f812f9d067d7a7b22d070e98d/app/src/main/java/com/madhav/com/ipl2018/di/module/NetModule.java#L95-L98", "https://github.com/KodiMadhavarao/Ipl2018/blob/7e38cccc4420116f812f9d067d7a7b22d070e98d/app/src/main/java/com/madhav/com/ipl2018/di/module/NetModule.java#L78-L81", "https://github.com/berviantoleo/learn-android/blob/d9249b2d6f272a75d9d243cce3a200c64db8f48c/app/src/main/java/com/personal/learn_android/GuestActivity.java#L82-L86" ]
29,331,075
RecyclerView blinking after notifyDatasetChanged()
https://stackoverflow.com/questions/29331075/recyclerview-blinking-after-notifydatasetchanged
Ali
https://stackoverflow.com/users/1315447/ali
ItemAnimator animator = recyclerView.getItemAnimator(); if (animator instanceof SimpleItemAnimator) { ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false); }
https://stackoverflow.com/a/32227316
Sabeer Mohammed
https://stackoverflow.com/users/1816268/sabeer-mohammed
[ 3030008, 3650234, 3318123 ]
[ "https://github.com/tynmarket/Serenade/blob/97b319e3e617928987c0dc1c772caa52f48a55b9/app/src/main/java/com/tynmarket/serenade/fragment/TweetListFragment.java#L241-L244", "https://github.com/pangyu646182805/PhotoSelector/blob/0cf45b2f7be9b838364ac4a8500f47014369f2ee/library/src/main/java/com/ppyy/photoselector/adapter/MediaAdapter.java#L80-L89", "https://github.com/XiaoSeee/MyApplication/blob/7a86ba61d2972df90a0b00856bb6b9053566dbf1/timershaft/src/main/java/com/wuxiang/timershaft/fragment/AlarmFragment.java#L40-L54" ]
8,386,832
Android: checkbox listener
https://stackoverflow.com/questions/8386832/android-checkbox-listener
Roman Rdgz
https://stackoverflow.com/users/808091/roman-rdgz
satView.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) { } } );
https://stackoverflow.com/a/8386876
Chris
https://stackoverflow.com/users/139506/chris
[ 1753034, 350096, 350095 ]
[ "https://github.com/tiagohs/PopMovies/blob/ff831d9bd5b97210254aa48639207f506e116319/app/src/main/java/br/com/tiagohs/popmovies/ui/view/fragment/FilterDialogFragment.java#L142-L149", "https://github.com/pwittchen/EEGReader/blob/a54d1298c9ab9ba81053cad4d1700a9b2bd4ea57/EEGReader/src/com/pwittchen/eegreader/activity/controller/SettingsController.java#L84-L91", "https://github.com/pwittchen/EEGReader/blob/a54d1298c9ab9ba81053cad4d1700a9b2bd4ea57/EEGReader/src/com/pwittchen/eegreader/activity/controller/SettingsController.java#L75-L82" ]
7,940,765
How to hide the soft keyboard from inside a fragment?
https://stackoverflow.com/questions/7940765/how-to-hide-the-soft-keyboard-from-inside-a-fragment
WilHall
https://stackoverflow.com/users/586606/wilhall
getActivity().getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
https://stackoverflow.com/a/23934639
Shajeel Afzal
https://stackoverflow.com/users/1773155/shajeel-afzal
[ 4662667, 887228, 2305645 ]
[ "https://github.com/jeff1191/AS_TUTOR/blob/b5e1c1bfbcf740a94847cf511768c93c93a9015b/app/src/main/java/es/ucm/as/presentacion/vista/tutor/FragmentDetalleTutor.java#L46-L50", "https://github.com/Samourai-Wallet/samourai-wallet-android/blob/383a569cce5a1bffc18072296352f81bf4a041aa/app/src/main/java/com/samourai/wallet/fragments/ImportWalletFragment.java#L71-L75", "https://github.com/rudsonlive/android-mvp/blob/3b7bb85395c21ef2e85970fd92db25bac0495ba7/app/src/main/java/br/com/liveo/mvp/base/BaseFragment.java#L38-L43" ]
5,545,217
Back button and refreshing previous activity
https://stackoverflow.com/questions/5545217/back-button-and-refreshing-previous-activity
Paul
https://stackoverflow.com/users/691946/paul
@Override public void onRestart() { super.onRestart(); //When BACK BUTTON is pressed, the activity on the stack is restarted //Do what you want on the refresh procedure here }
https://stackoverflow.com/a/21073001
Sarah Sakamoto
https://stackoverflow.com/users/1002454/sarah-sakamoto
[ 2198281, 3049267, 3456938 ]
[ "https://github.com/cerisara/mousetodon/blob/737719f62f4820a1bff84187390e5cde9815ad27/src/fr/xtof54/mousetodon/MouseApp.java#L86-L86", "https://github.com/zwping/PSeries/blob/13bb864528a1e926ca28776993ba0887e5d14f03/plib/src/main/java/win/zwping/plib/basis/BasisLifeCycleActivity.java#L87-L89", "https://github.com/zdavatz/generika_android/blob/fca394c6be231f9a69a45175989162b488a570c1/app/src/main/java/org/oddb/generika/BaseActivity.java#L56-L58" ]
19,517,417
Opening Android Settings programmatically
https://stackoverflow.com/questions/19517417/opening-android-settings-programmatically
Behnam
https://stackoverflow.com/users/1576010/behnam
startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
https://stackoverflow.com/a/19517448
kjurkovic
https://stackoverflow.com/users/508126/kjurkovic
[ 611666, 4429764, 3748410 ]
[ "https://github.com/michelelacorte/FlickLauncher/blob/6eaf0676bfa60eb6f67c7b122acdd5e84607c9cc/src/com/android/launcher3/Utilities.java#L1658-L1660", "https://github.com/param-jot/Bodies-coach/blob/2db6a1c10623497293a2e04842a2ac8af93411e0/app/src/main/java/digimantra/com/bodiestv/CommonClasses/BaseActivity.java#L70-L84", "https://github.com/LisacPisac/TruckTrack/blob/f43586cee4f167aa4f88fd614d5bd098fdbffc8f/app/src/main/java/hr/foi/air/trucktrack/LoginActivity.java#L143-L157" ]
4,074,937
Android: How to get a custom View's height and width?
https://stackoverflow.com/questions/4074937/android-how-to-get-a-custom-views-height-and-width
Rohith Nandakumar
https://stackoverflow.com/users/481239/rohith-nandakumar
@Override protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld){ super.onSizeChanged(xNew, yNew, xOld, yOld); viewWidth = xNew; viewHeight = yNew; }
https://stackoverflow.com/a/9718512
Paresh Mayani
https://stackoverflow.com/users/379693/paresh-mayani
[ 341919, 742126, 1294027 ]
[ "https://github.com/zjw-swun/AppMethodOrder/blob/8bbe7a848398b2e81c1c0ed9b9b4d00a2350776b/app/src/main/java/com/zjw/appmethodorder/MyTextView.java#L54-L56", "https://github.com/yaa110/Effects-Pro/blob/f4dc18485cb179205853be842c4d4740505a3c09/src/android/widget/VerticalSeekBar.java#L23-L25", "https://github.com/wuyongxiang/ScreenElf/blob/b6e092dd96a1b083e931f55ed181e18ee3a75322/app/src/main/java/com/xiangzi/screenelf/LineView.java#L75-L77" ]
3,629,179
Android activity over default lock screen
https://stackoverflow.com/questions/3629179/android-activity-over-default-lock-screen
plugmind
https://stackoverflow.com/users/387710/plugmind
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
https://stackoverflow.com/a/5727133
Enes
https://stackoverflow.com/users/686463/enes
[ 2621490, 4520245, 491517 ]
[ "https://github.com/bapspatil/Mockingbird/blob/2900bd5675858f942bff4da9dd2439b62e99de00/app/src/main/java/bapspatil/mockingbird/ui/QuestionsActivity.java#L156-L161", "https://github.com/SwapnilBhosale/BotoPia/blob/ee06516fc76866d3ac9182674a3d342e53f93d33/app/src/main/java/gslab/com/myapplication/CallAnswerReject.java#L92-L97", "https://github.com/natario1/CameraView/blob/4c6a8db0c398b6334e47b41c226660a9c7d0fffb/cameraview/src/androidTest/java/com/otaliastudios/cameraview/TestActivity.java#L52-L58" ]
4,746,075
Seamless video Loop with VideoView
https://stackoverflow.com/questions/4746075/seamless-video-loop-with-videoview
SamRowley
https://stackoverflow.com/users/400406/samrowley
videoView.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.setLooping(true); } });
https://stackoverflow.com/a/8431374
PravinDodia
https://stackoverflow.com/users/874286/pravindodia
[ 4246820, 1487866, 3182809 ]
[ "https://github.com/D-Cube/Emoji-Fy/blob/304b419ad6cb300a606e06bc8cde8e17acba9652/EMOJIFY/app/src/main/java/com/example/android/emojify/MainActivity.java#L64-L73", "https://github.com/beanu/smart-farmer-android/blob/7dc9a657ee70e840fe14a9e43e994657b8c6c343/l3_guide/src/main/java/com/beanu/l3_guide/video/GuideVideoActivity.java#L130-L140", "https://github.com/SequencingDOTcom/Weather-My-Way-RTP-app/blob/9bad3f1fd52f8752b24686f8177e582f98a0608f/Android/app/src/main/java/com/sequencing/weather/activity/WeatherPreferenceActivity.java#L207-L220" ]
32,343,183
(Retrofit) Could not locate converter for class crashing app
https://stackoverflow.com/questions/32343183/retrofit-could-not-locate-converter-for-class-crashing-app
Orbit
https://stackoverflow.com/users/3917064/orbit
Retrofit retrofit = new Retrofit.Builder() .baseUrl(Constants.API_BASE_URL) .addConverterFactory(GsonConverterFactory.create()) .build();
https://stackoverflow.com/a/32353578
YacSrk
https://stackoverflow.com/users/2318717/yacsrk
[ 2439984, 2439982, 2866692 ]
[ "https://github.com/KodiMadhavarao/Ipl2018/blob/7e38cccc4420116f812f9d067d7a7b22d070e98d/app/src/main/java/com/madhav/com/ipl2018/di/module/NetModule.java#L95-L98", "https://github.com/KodiMadhavarao/Ipl2018/blob/7e38cccc4420116f812f9d067d7a7b22d070e98d/app/src/main/java/com/madhav/com/ipl2018/di/module/NetModule.java#L78-L81", "https://github.com/berviantoleo/learn-android/blob/d9249b2d6f272a75d9d243cce3a200c64db8f48c/app/src/main/java/com/personal/learn_android/GuestActivity.java#L82-L86" ]
3,355,367
Height of statusbar?
https://stackoverflow.com/questions/3355367/height-of-statusbar
user291701
https://stackoverflow.com/users/291701/user291701
public int getStatusBarHeight() { int result = 0; int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = getResources().getDimensionPixelSize(resourceId); } return result; }
https://stackoverflow.com/a/3356263
Jorgesys
https://stackoverflow.com/users/250260/jorgesys
[ 2902960, 2902943, 1526305 ]
[ "https://github.com/brenpearson/drift-android/blob/d027fc4706ee332536998f6836e4887469117400/app/src/main/java/com/brenpearson/tide/StreamActivity.java#L418-L423", "https://github.com/brenpearson/drift-android/blob/d027fc4706ee332536998f6836e4887469117400/app/src/main/java/com/brenpearson/tide/OnboardingActivity.java#L44-L49", "https://github.com/yiwent/Mobike/blob/1709c7396272729490931d3ec10a63a9afd8a86d/app/src/main/java/com/yiwen/mobike/base/BaseActivity.java#L31-L37" ]
2,470,870
Force application to restart on first activity
https://stackoverflow.com/questions/2470870/force-application-to-restart-on-first-activity
Sephy
https://stackoverflow.com/users/263521/sephy
Intent i = getBaseContext().getPackageManager() .getLaunchIntentForPackage( getBaseContext().getPackageName() ); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i);
https://stackoverflow.com/a/3772987
Marc
https://stackoverflow.com/users/455477/marc
[ 3320681, 300154, 4548780 ]
[ "https://github.com/hebatallahessam/kidsApp/blob/f910f89d63766c0a2ba1972f00e6e4d059e55520/app/src/main/java/com/example/android/kids/MainActivity.java#L72-L76", "https://github.com/ZieIony/Carbon/blob/7c3134b7861c79e00c603eac4b1913160a189274/samples/src/main/java/tk/zielony/carbonsamples/ColorsActivity.java#L138-L142", "https://github.com/s0urc3d3v3l0pm3nt/tipsUX/blob/6291f41dc93c74e4ae56e19879f7aa46dbc47bd7/app/src/main/java/net/techredesign/uxfortips/colorSelector.java#L270-L275" ]
2,279,978
webview showing white bar on right side
https://stackoverflow.com/questions/2279978/webview-showing-white-bar-on-right-side
Kshitij Aggarwal
https://stackoverflow.com/users/237403/kshitij-aggarwal
//webview being your WebView object reference. webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
https://stackoverflow.com/a/2766399
Chris Danielson
https://stackoverflow.com/users/332500/chris-danielson
[ 2883060, 1633153, 3057868 ]
[ "https://github.com/skyleet/Android-Projects/blob/2cc574e85323ad00fe6ee0bd5475429c4ae12ea5/Plinth_2-master/app/src/main/java/lnmiit/madclub/plinth/NavigationDrawerFragment/Map.java#L23-L36", "https://github.com/mikifus/padland/blob/c4bc6345951352a9586bba1e75db1d81447a89d6/app/src/main/java/com/mikifus/padland/PadViewActivity.java#L576-L590", "https://github.com/bernardoleary/MyBigBro-Android/blob/429542cd277241b9637899378fca633042147385/app/src/main/java/com/infostructure/mybigbro/ui/activities/AboutActivity.java#L35-L50" ]
29,294,015
How to check if user is logged in with FB SDK 4.0 for Android?
https://stackoverflow.com/questions/29294015/how-to-check-if-user-is-logged-in-with-fb-sdk-4-0-for-android
Felipe
https://stackoverflow.com/users/4259129/felipe
public boolean isLoggedIn() { AccessToken accessToken = AccessToken.getCurrentAccessToken(); return accessToken != null; }
https://stackoverflow.com/a/30042704
Felipe Mosso
https://stackoverflow.com/users/2026010/felipe-mosso
[ 4176675, 4075149, 4543820 ]
[ "https://github.com/williammatias/SocialPrivacy-Android/blob/5c0b00e685f39770d51fe5a7a3e36f5f0c05bd6a/app/src/main/java/com/williammatias/socialunmask/MainActivity.java#L87-L90", "https://github.com/wenzla/BlindChess/blob/6ebdb5cbda215da770e98037c3d017eb7fabf2f2/myApp/app/src/main/java/io/github/wenzla/testapp/MainActivity.java#L333-L336", "https://github.com/shreeyasharma/SpeakUpApp/blob/7523b8241dd5e145eccbdd917663c99b452fd559/app/src/main/java/com/example/afreen/speakupfinal/LoginFragment.java#L129-L132" ]
11,292,950
Push up content when clicking in edit text
https://stackoverflow.com/questions/11292950/push-up-content-when-clicking-in-edit-text
Neil
https://stackoverflow.com/users/1326425/neil
getActivity().getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
https://stackoverflow.com/a/28012530
David Fischer
https://stackoverflow.com/users/2504931/david-fischer
[ 2272476, 2272451, 3600225 ]
[ "https://github.com/fzachariah/Android-Projects/blob/b5338a8bf6ffbff59d66e0ba00d51b00df239f9d/25.TripFinder Application/Group21_HW09/app/src/main/java/com/example/febin/group21_hw09/HomePageFragment.java#L131-L135", "https://github.com/fzachariah/Android-Projects/blob/b5338a8bf6ffbff59d66e0ba00d51b00df239f9d/25.TripFinder Application/Group21_HW09/app/src/main/java/com/example/febin/group21_hw09/ChatFragment.java#L125-L129", "https://github.com/ShaneCreedon/Animation-Doodle/blob/58905882249723e69b8c0cb6ffd7ee0f1040b7b9/code/app/src/main/java/ca326/com/activities/ItemOneFragment.java#L18-L22" ]
11,330,363
How to detect device is Android phone or Android tablet?
https://stackoverflow.com/questions/11330363/how-to-detect-device-is-android-phone-or-android-tablet/11330947
KAPLANDROID
https://stackoverflow.com/users/1430119/kaplandroid
public static boolean isTablet(Context context) { return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE; }
https://stackoverflow.com/a/11330947
Alex Lockwood
https://stackoverflow.com/users/844882/alex-lockwood
[ 1691620, 1148431, 3375794 ]
[ "https://github.com/zeevy/grblcontroller/blob/fcf1fc759b5012302cd23b8b01d72af6d4d83d2c/app/src/main/java/in/co/gorest/grblcontroller/GrblActivity.java#L278-L280", "https://github.com/webianks/EasyFeedback/blob/7c2830543e611fd2f6d7e9435810d1978aa77d18/easy-feedback/src/main/java/com/webianks/easy_feedback/components/DeviceInfo.java#L157-L159", "https://github.com/vdribeiro/companion_library/blob/4609c9d56f9a37a1431344e7808128cbf64923bc/app/src/main/java/companion/support/v8/os/Utils.java#L405-L407" ]
4,780,899
Intercept and override HTTP requests from WebView
https://stackoverflow.com/questions/4780899/intercept-and-override-http-requests-from-webview
Olegas
https://stackoverflow.com/users/296433/olegas
webView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.startsWith("foo://")) { // magic return true; } return false; } });
https://stackoverflow.com/a/4805033
Axarydax
https://stackoverflow.com/users/72746/axarydax
[ 4633934, 2631230, 3550830 ]
[ "https://github.com/tonytran1/WebView-Template/blob/d0319a8cacc3ab54a4f3e3bebb880b429ad49148/app/src/main/java/web/webapp/WebActivity.java#L71-L79", "https://github.com/b2stry/milu-tv/blob/7f9886cfb1f9a06ac3079d41a2cab21efc762ce9/app/src/main/java/com/shallowan/milutv/webview/WebViewActivity.java#L50-L59", "https://github.com/YoungBear/Hello/blob/6a79c35f7863a67aa2c114a4e4758193d47c1083/app/src/main/java/com/example/hello/activity/WebViewActivity.java#L28-L37" ]
18,475,826
How to perform a fade animation on Activity transition?
https://stackoverflow.com/questions/18475826/how-to-perform-a-fade-animation-on-activity-transition
MarcForn
https://stackoverflow.com/users/1924317/marcforn
Intent i = new Intent(this, NewlyStartedActivity.class); startActivity(i); overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
https://stackoverflow.com/a/18475926
Philipp Jahoda
https://stackoverflow.com/users/1590502/philipp-jahoda
[ 149190, 3442098, 3442099 ]
[ "https://github.com/sockeqwe/mosby/blob/7aa9aa9769ff896d70a18a845a1e0520799d048e/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/IntentStarter.java#L79-L83", "https://github.com/KevinMulkearn/SiteColorGrabber/blob/e18af98a5cdcad229283839faf345bfc2fe7cc1c/app/src/main/java/com/mulkearn/kevin/sitecolorgrabber/MainActivity.java#L16-L20", "https://github.com/KevinMulkearn/SiteColorGrabber/blob/e18af98a5cdcad229283839faf345bfc2fe7cc1c/app/src/main/java/com/mulkearn/kevin/sitecolorgrabber/MainActivity.java#L22-L26" ]
7,584,036
android: Softkeyboard perform action when Done key is pressed
https://stackoverflow.com/questions/7584036/android-softkeyboard-perform-action-when-done-key-is-pressed
Khawar Raza
https://stackoverflow.com/users/851491/khawar-raza
editText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if(actionId==EditorInfo.IME_ACTION_DONE){ //do something } return false; } });
https://stackoverflow.com/a/7584154
Adil Soomro
https://stackoverflow.com/users/593709/adil-soomro
[ 1784370, 2605525, 4189488 ]
[ "https://github.com/chetdeva/login-bindings/blob/f2d4317b522bf78ede0577cbc2fac6e0376ab2d2/app/src/main/java/com/fueled/loginbindings/BindingAdapter.java#L23-L33", "https://github.com/sufushi/gdut_activity/blob/425547eee03f5111eb75a6c5c612d7cbaa37ebf5/app/src/main/java/com/rdc/gdut_activity/ui/LoginActivity.java#L60-L71", "https://github.com/grahamearley/ShareToReadingAndroid/blob/52857043ba00da7c41d07b850f1631670bd74484/app/src/main/java/xyz/egie/sharetoreadingam/SettingsActivity.java#L92-L103" ]
3,609,174
Android: Insert text into EditText at current position
https://stackoverflow.com/questions/3609174/android-insert-text-into-edittext-at-current-position
Manuel
https://stackoverflow.com/users/388826/manuel
int start = Math.max(myEditText.getSelectionStart(), 0); int end = Math.max(myEditText.getSelectionEnd(), 0); myEditText.getText().replace(Math.min(start, end), Math.max(start, end), textToInsert, 0, textToInsert.length());
https://stackoverflow.com/a/3611576
Manuel
https://stackoverflow.com/users/388826/manuel
[ 1297758, 3562940, 1002459 ]
[ "https://github.com/luoyesiqiu/Ziyue/blob/320b933e95a79ec732ed68431fc0407a213a8c02/app/src/main/java/com/woc/chat/emoji/EmojiconsFragment.java#L146-L158", "https://github.com/deepakjainlnct/emojicon-master/blob/506cde4025db978b6efcda631fb7c6eeac310ced/library/src/main/java/com/deepak/app/emojicon/EmojiconsFragment.java#L121-L133", "https://github.com/chathudan/KitKatEmoji/blob/1aa860b781d5b3d342ac8786e2b7081e18bf35e8/KitKatEmoji/src/main/java/com/sithagi/kitkatemoji/EmojiconsFragment.java#L38-L50" ]
27,611,173
How to get accent color programmatically?
https://stackoverflow.com/questions/27611173/how-to-get-accent-color-programmatically
Jakob
https://stackoverflow.com/users/1692590/jakob
private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = mContext.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle(); return color; }
https://stackoverflow.com/a/27611244
rciovati
https://stackoverflow.com/users/321354/rciovati
[ 802676, 3208678, 616642 ]
[ "https://github.com/sangcomz/FishBun/blob/90d4f9bf2f0025e109b414e957fe4202dc83a670/FishBun/src/main/java/com/sangcomz/fishbun/util/RadioWithTextButton.java#L150-L156", "https://github.com/rockstar016/Calculator/blob/bd1bee58f9af59ebac174e5f6b2b502f78a15de6/app/src/main/java/calc/rock/calculator/SettingScreen/RecyclerViewAdapter.java#L58-L64", "https://github.com/polyak01/IconSwitch/blob/9d4970a3049434dbea1c43b8061565f63671757e/iconswitch/src/main/java/com/polyak/iconswitch/IconSwitch.java#L498-L504" ]
17,207,366
creating a menu after a long click event on a list view
https://stackoverflow.com/questions/17207366/creating-a-menu-after-a-long-click-event-on-a-list-view
Eriz
https://stackoverflow.com/users/2468752/eriz
view.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { @Override public void onCreateContextMenu(final ContextMenu menu, final View v, final ContextMenuInfo menuInfo) { } });
https://stackoverflow.com/a/17207471
7bluephoenix
https://stackoverflow.com/users/1995735/7bluephoenix
[ 597395, 4310374, 1802252 ]
[ "https://github.com/cgeo/cgeo/blob/0d134229e423d53b583e9f4edbcaf9b104f501da/main/src/cgeo/geocaching/NavigateAnyPointActivity.java#L140-L173", "https://github.com/Maicius/Wake_client/blob/f19db00973b7d7b8f43e0d2feee260ad630d4a77/CRAZYCLOCK/app/src/main/java/com/maicius/wake/Friends/ConditionSearchFriend.java#L74-L100", "https://github.com/SShineTeam/Huochexing12306/blob/75f41e842d600df03615666ad3215760cdc93032/HuoCheXing/src/main/java/com/sshine/huochexing/ticketOnline/MonitorMangAty.java#L122-L132" ]
24,587,925
SwipeRefreshLayout trigger programmatically
https://stackoverflow.com/questions/24587925/swiperefreshlayout-trigger-programmatically
Niklas
https://stackoverflow.com/users/1979703/niklas
mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { mSwipeRefreshLayout.setRefreshing(true); } });
https://stackoverflow.com/a/28002305
Ramz
https://stackoverflow.com/users/1103284/ramz
[ 1756695, 4306656, 4306605 ]
[ "https://github.com/lethalskillzz/Blockbusters/blob/8b4175b9f4d7a2f3276967c74ef044eedf88bc57/app/src/main/java/com/lethalskillzz/blockbusters/blockbusters/presentation/Discovery/DiscoveryActivity.java#L158-L164", "https://github.com/yeshuwei/WuLiao/blob/3566a586fc5b7c22a928ba83c7f09faff5da1215/app/src/main/java/com/wuliao/mvp/one/OneFragment.java#L101-L108", "https://github.com/yeshuwei/WuLiao/blob/3566a586fc5b7c22a928ba83c7f09faff5da1215/app/src/main/java/com/wuliao/mvp/detail/url/WebFragment.java#L198-L205" ]
19,079,400
ArrayAdapter in android to create simple listview
https://stackoverflow.com/questions/19079400/arrayadapter-in-android-to-create-simple-listview
Nirav Kamani
https://stackoverflow.com/users/2592727/nirav-kamani
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, values);
https://stackoverflow.com/a/19079540
Raghunandan
https://stackoverflow.com/users/653856/raghunandan
[ 3387018, 3163308, 3762863 ]
[ "https://github.com/n0m0r3pa1n/android-clean-videos/blob/b60a1974a7b3a5e7864b063b9329369d95cbe9de/app/src/main/java/com/nmp90/mycleanvideos/details/DetailsActivity.java#L55-L59", "https://github.com/tkmarsh/chanu/blob/0f2a5449916d4898304243e91951d6529933ddad/app/src/main/java/com/chanapps/four/widget/AbstractWidgetConfigureActivity.java#L89-L94", "https://github.com/bhavrishi/My-Android-Apps/blob/9688a0a96bf3d3b3b6a15b6c2ca44a9e986b1d75/InClass03_Group23 2/DataPAssing/app/src/main/java/com/hwork/uncc/datapassing/MainActivity.java#L18-L23" ]
17,498,478
Navigation drawer - Disable click through on items behind the drawer
https://stackoverflow.com/questions/17498478/navigation-drawer-disable-click-through-on-items-behind-the-drawer
user1240989
https://stackoverflow.com/users/1240989/user1240989
mFragmentContainerView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } });
https://stackoverflow.com/a/33559540
Everson Rafael
https://stackoverflow.com/users/1757875/everson-rafael
[ 2873632, 4333158, 424138 ]
[ "https://github.com/tplloi/basemaster/blob/7eaf44d0a37e603296995566f6ec6a3b8569f1e4/core/src/main/java/vn/loitp/views/placeholderview/lib/placeholderview/SwipeViewBinder.java#L653-L660", "https://github.com/talAriel/tinderForYourPhotos/blob/72f371d5bad077de0dfa63a5ab8e28f444ea7398/App/Industrial_Project/placeholderview/src/main/java/com/mindorks/placeholderview/SwipeViewBinder.java#L637-L644", "https://github.com/janishar/PlaceHolderView/blob/7a4bb8b290ff9ab15c483e0fb1ec1eb7d0f0d508/placeholderview/src/main/java/com/mindorks/placeholderview/SwipeViewBinder.java#L471-L478" ]
1,052,300
How to call a .NET Webservice from Android using KSOAP2?
https://stackoverflow.com/questions/1052300/how-to-call-a-net-webservice-from-android-using-ksoap2
Rajapandian
https://stackoverflow.com/users/111436/rajapandian
SoapPrimitive result = (SoapPrimitive)envelope.getResponse(); String strRes = result.toString();
https://stackoverflow.com/a/1923630
ali
https://stackoverflow.com/users/234011/ali
[ 3523554, 3280708, 3280709 ]
[ "https://github.com/marabesi/android-playground/blob/3358b6b158b2597705715fc9b3b3caf24a334af4/Login_Webservice/app/src/main/java/com/example/loginwebservice/login_webservice/LoginAsyncTask.java#L13-L34", "https://github.com/jhonatashbc/ProjetoTCC-1.0/blob/4239581d6c59429a78471806587b45310e91836a/app/src/main/java/com/example/jhonatashenrique/projetotcc/CoordDAO.java#L24-L48", "https://github.com/jhonatashbc/ProjetoTCC-1.0/blob/4239581d6c59429a78471806587b45310e91836a/app/src/main/java/com/example/jhonatashenrique/projetotcc/CoordDAO.java#L50-L74" ]
6,814,268
Android - Share on Facebook, Twitter, Mail, ecc
https://stackoverflow.com/questions/6814268/android-share-on-facebook-twitter-mail-ecc
Andrea Mario Lufino
https://stackoverflow.com/users/588967/andrea-mario-lufino
String message = "Text I want to share."; Intent share = new Intent(Intent.ACTION_SEND); share.setType("text/plain"); share.putExtra(Intent.EXTRA_TEXT, message); startActivity(Intent.createChooser(share, "Title of the dialog the system will open"));
https://stackoverflow.com/a/6814434
Janusz
https://stackoverflow.com/users/114066/janusz
[ 2265988, 4218057, 539319 ]
[ "https://github.com/zhongchenyu/jokes/blob/d70edd9f3ab89bb991c9d694e73a11f6b9724a1c/app/src/main/java/chenyu/jokes/widget/ShareWindow.java#L74-L79", "https://github.com/zhcppy/imemory/blob/187aada3966c976c8e1406004ab4d48ae92c3aef/app/src/main/java/club/imemory/app/util/NavigatorUtil.java#L76-L81", "https://github.com/syncthing/syncthing-android/blob/7279ac7630220ff59b6937cc413c613d2f8371ca/app/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java#L386-L391" ]
2,470,870
How to 'restart' an android application programmatically
https://stackoverflow.com/questions/2470870/force-application-to-restart-on-first-activity
Sephy
https://stackoverflow.com/users/263521/sephy
Intent i = getBaseContext().getPackageManager() .getLaunchIntentForPackage( getBaseContext().getPackageName() ); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i);
https://stackoverflow.com/a/3772987
Marc
https://stackoverflow.com/users/455477/marc
[ 3320681, 300154, 4548780 ]
[ "https://github.com/hebatallahessam/kidsApp/blob/f910f89d63766c0a2ba1972f00e6e4d059e55520/app/src/main/java/com/example/android/kids/MainActivity.java#L72-L76", "https://github.com/ZieIony/Carbon/blob/7c3134b7861c79e00c603eac4b1913160a189274/samples/src/main/java/tk/zielony/carbonsamples/ColorsActivity.java#L138-L142", "https://github.com/s0urc3d3v3l0pm3nt/tipsUX/blob/6291f41dc93c74e4ae56e19879f7aa46dbc47bd7/app/src/main/java/net/techredesign/uxfortips/colorSelector.java#L270-L275" ]
15,142,089
How to display my location on Google Maps for Android API v2
https://stackoverflow.com/questions/15142089/how-to-display-my-location-on-google-maps-for-android-api-v2
Yos233
https://stackoverflow.com/users/1659045/yos233
// map is a GoogleMap object map.setMyLocationEnabled(true);
https://stackoverflow.com/a/15142091
Yos233
https://stackoverflow.com/users/1659045/yos233
[ 4558168, 1263114, 2320982 ]
[ "https://github.com/mchudy/tapfinder/blob/1cd6c3e93e0466fd22dc207f5433a1878256f5e2/app/src/main/java/tk/tapfinderapp/view/map/MapFragment.java#L78-L80", "https://github.com/mapzen/android/blob/0cbf18945cdb03cad5859fc9cff4804333ac29bb/mapzen-places-api/src/main/java/com/mapzen/places/api/internal/PlacePickerPresenterImpl.java#L71-L73", "https://github.com/aprofromindia/ReDI-Android-Course/blob/e16a78944627dffb12b0e9110a9422d22c8e312e/Code/FreeWifi/app/src/main/java/com/github/aprofromindia/freewifi/venues/MainActivity.java#L62-L64" ]
30,354,258
Android google maps marker disable navigation option
https://stackoverflow.com/questions/30354258/android-google-maps-marker-disable-navigation-option
Sven van den Boogaart
https://stackoverflow.com/users/1667868/sven-van-den-boogaart
GoogleMap map; map.getUiSettings().setMapToolbarEnabled(false);
https://stackoverflow.com/a/30354428
Pavel Dudka
https://stackoverflow.com/users/1277362/pavel-dudka
[ 3796881, 1572919, 3781873 ]
[ "https://github.com/naijab/PokemoNear/blob/110d39798d3aa62230e35549e275cf06edb19196/app/src/main/java/com/naijab/pokemonear/maps/MapsFragment.java#L190-L197", "https://github.com/ZafraniTechLLC/Companion-For-PUBG-Android/blob/77fcb7d477b75fc70a9d44bc6265091c3f1caa74/app/src/main/java/tech/zafrani/companionforpubg/maps/GoogleMapControllerImpl.java#L77-L84", "https://github.com/Lorenaupc/ArvApp-2.0/blob/54233ed83fcd5a451d4abd43797cb593c9453c2e/app/src/main/java/arvapp/navigation/MapFragment.java#L47-L54" ]
16,092,431
Check for navigation bar
https://stackoverflow.com/questions/16092431/check-for-navigation-bar
Jonno
https://stackoverflow.com/users/882438/jonno
boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey(); boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK); if(!hasMenuKey && !hasBackKey) { // Do whatever you need to do, this device has a navigation bar }
https://stackoverflow.com/a/16608481
philask
https://stackoverflow.com/users/1451267/philask
[ 3610165, 4710518, 4339921 ]
[ "https://github.com/zhangxyfs/Android_Pack_MVP/blob/ff382099cb1604d6fbc8606149340b2d80c199c4/Base/src/main/java/com/z7dream/apm/base/utils/tools/Utils.java#L235-L239", "https://github.com/cookingbear/ImpressWeibo/blob/0ec5822a17707f2cd4fbaa4ce693c9fe8d0ce725/impressWeibo/src/main/src/org/bigbear/impressweibo/support/utils/Utility.java#L1031-L1036", "https://github.com/cnwutianhao/AndroidUtils/blob/79af45c06a1241ea473354874008d435d4f0af25/app/src/main/java/com/haocent/android/androidutil/utils/ScreenUtil.java#L318-L323" ]
27,187,733
No animation on item removal on RecyclerView
https://stackoverflow.com/questions/27187733/no-animation-on-item-removal-on-recyclerview
Jordi Chacón
https://stackoverflow.com/users/427080/jordi-chac%c3%b3n
myDataset.remove(position); // myDataset is List<MyObject> mAdapter.notifyItemRemoved(position);
https://stackoverflow.com/a/33693721
Much Overflow
https://stackoverflow.com/users/3533289/much-overflow
[ 2544325, 3323731, 144373 ]
[ "https://github.com/nikartm/AndroidUsefulExamples/blob/3807ec5ea6fe4722318df479d5dd8841424f0aeb/drag-and-drop/src/main/java/ru/nikartm/drag_and_drop/fragment/ListItemFragment.java#L62-L65", "https://github.com/mhdr/AndroidSamples/blob/e3b5691c59f578e365e28ee7483daa5e8dce5e01/086/app/src/main/java/ir/mhdr/a086/MainActivity.java#L87-L90", "https://github.com/h6ah4i/android-advancedrecyclerview/blob/ed42db6ab4cc151c6509accf029b8febeaa2cb90/example/src/main/java/com/h6ah4i/android/example/advrecyclerview/demo_s_minimal/MinimalSwipeableExampleActivity.java#L163-L166" ]
8,785,023
How to close Android Soft KeyBoard programmatically?
https://stackoverflow.com/questions/8785023/how-to-close-android-soft-keyboard-programmatically/39586663
Mak
https://stackoverflow.com/users/556869/mak
//to show soft keyboard imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); //to hide it, call the method again imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
https://stackoverflow.com/a/8785471
user942821
N/A
[ 2300646, 4613071, 1194863 ]
[ "https://github.com/triline3/timecat/blob/fdb54695c417366ca2c5e0978bae4ef856f74b74/app/src/main/java/com/time/cat/util/keyboard/KeyboardUtil.java#L58-L61", "https://github.com/sthepatel/HPI_Fit/blob/c9c6612a699da49e9ac5fd4870089737ec0c924d/hpi/src/main/java/info/smitpatel/hpifit/app/SystemHelper.java#L46-L49", "https://github.com/michaelbel/Material/blob/da1596ccdee0c6cb07a38473131edbaf2f8d04aa/material/src/main/java/org/michaelbel/material/util2/Utils.java#L131-L134" ]
6,362,314
Wifi Connect-Disconnect Listener
https://stackoverflow.com/questions/6362314/wifi-connect-disconnect-listener
Neha
https://stackoverflow.com/users/800124/neha
public class WifiReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { ConnectivityManager conMan = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = conMan.getActiveNetworkInfo(); if (netInfo != null && netInfo.getType() == ConnectivityManager.TYPE_WIFI) Log.d("WifiReceiver", "Have Wifi Connection"); else Log.d("WifiReceiver", "Don't have Wifi Connection"); } };
https://stackoverflow.com/a/12894153
warbi
https://stackoverflow.com/users/1140744/warbi
[ 4545919, 500097, 1189902 ]
[ "https://github.com/ShiTuoCheng/SWeather/blob/277ff5c816006a14b91b6cb66664f09158d6b7db/app/src/main/java/com/shituocheng/sweather/com/sweather/utilis/Utils.java#L1-L1", "https://github.com/xingda920813/XDUpdate/blob/ce7b4f084f85b885abd246b2acdc659d95671f23/xdupdate/src/main/java/com/xdandroid/xdupdate/XdUpdateUtils.java#L141-L144", "https://github.com/rRemix/APlayer/blob/48b7a48889d961fcf175071f2c7f2db6d69f5a6c/app/src/main/java/remix/myplayer/util/Util.java#L421-L424" ]
5,403,308
make a phone call click on a button
https://stackoverflow.com/questions/5403308/make-a-phone-call-click-on-a-button
prasad.gai
https://stackoverflow.com/users/769225/prasad-gai
Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:123456789")); startActivity(callIntent);
https://stackoverflow.com/a/5404269
Shaista Naaz
https://stackoverflow.com/users/628090/shaista-naaz
[ 2664499, 3668757, 3330172 ]
[ "https://github.com/zhaoqp2010/andbase3x/blob/8e5300972667135e3fd1c7b49b4fd60492269067/andbase3x/andbase/src/main/java/com/andbase/library/util/AbAppUtil.java#L643-L647", "https://github.com/maciej-nowak/My-CV/blob/02f62358844e63cc64f6b5c12674b4ed577a1963/app/src/main/java/pl/maciej_nowak/mycv/about/AboutFragment.java#L102-L106", "https://github.com/jesusjimsa/PersonalAssistant-Android-UAIC/blob/877f2e98d776d354eb7f14d8feed4b4d03f01303/app/src/main/java/com/example/jesusjimsa/personalassistant/MainActivity.java#L137-L141" ]
3,105,673
How to kill an application with all its activities?
https://stackoverflow.com/questions/3105673/how-to-kill-an-application-with-all-its-activities
Nils
https://stackoverflow.com/users/331556/nils
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch(resultCode) { case RESULT_CLOSE_ALL: setResult(RESULT_CLOSE_ALL); finish(); } super.onActivityResult(requestCode, resultCode, data); }
https://stackoverflow.com/a/3106670
mtmurdock
https://stackoverflow.com/users/339428/mtmurdock
[ 1534863, 1409990, 1189291 ]
[ "https://github.com/ultrasonic/ultrasonic/blob/881c85a390d726b765973d8362790dd7e90d06fa/ultrasonic/src/main/java/org/moire/ultrasonic/activity/ResultActivity.java#L16-L25", "https://github.com/huhx0015/EXWEAR_TutorialVideos/blob/407ea738c1be3380423a60d94ad9b3fb1642c88d/app/src/main/java/us/gpop/exwear/EXMain.java#L132-L141", "https://github.com/rRemix/APlayer/blob/48b7a48889d961fcf175071f2c7f2db6d69f5a6c/app/src/main/java/remix/myplayer/ui/activity/RecordShareActivity.java#L280-L284" ]
2,190,126
Is there any way to receive a notification when the user powers off the device?
https://stackoverflow.com/questions/2190126/is-there-any-way-to-receive-a-notification-when-the-user-powers-off-the-device
BenIOs
https://stackoverflow.com/users/265023/benios
public class ShutdownReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { //Insert code here } }
https://stackoverflow.com/a/2190184
Dave Webb
https://stackoverflow.com/users/3171/dave-webb
[ 205136, 888309, 888308 ]
[ "https://github.com/robolectric/robolectric/blob/c5278fbb8c60f238fa177d029a320196cd568f0b/robolectric/src/test/java/org/robolectric/shadows/ShadowContextWrapperTest.java#L411-L417", "https://github.com/yandextaxitech/binaryprefs/blob/65e6019ab3b5f9c53107208513ecbfca38b13534/library/src/main/java/com/ironz/binaryprefs/event/BroadcastEventBridge.java#L109-L116", "https://github.com/yandextaxitech/binaryprefs/blob/65e6019ab3b5f9c53107208513ecbfca38b13534/library/src/main/java/com/ironz/binaryprefs/event/BroadcastEventBridge.java#L100-L107" ]
30,284,627
How To Show and hide ActionBar with AppCompat v.7
https://stackoverflow.com/questions/30284627/how-to-show-and-hide-actionbar-with-appcompat-v-7
Timothy Steele
https://stackoverflow.com/users/4087164/timothy-steele
getSupportActionBar().hide(); // for hiding getSupportActionBar().show(); // for showing
https://stackoverflow.com/a/30284744
theapache64
https://stackoverflow.com/users/4370279/theapache64
[ 616431, 2303647, 3301553 ]
[ "https://github.com/maoruibin/GankDaily/blob/bbdf5a79c336968ed7308d562aeff4ede8dd2736/app/src/main/java/com/gudong/gankio/ui/activity/GirlFaceActivity.java#L177-L183", "https://github.com/4332weizi/DataBinding-Watchdog/blob/d9530c30e10793a93003359fc717c25b2564d927/sample/src/main/java/io/auxo/databinding/watchdog/sample/view/BrowserActivity.java#L44-L50", "https://github.com/abelgomez/tt-rss-android/blob/7ed29a91294dab318082bce715cf2189dc53369c/org.fox.ttrss/src/main/java/org/fox/ttrss/YoutubePlayerActivity.java#L55-L62" ]
18,996,183
Identifying RTL language in Android
https://stackoverflow.com/questions/18996183/identifying-rtl-language-in-android
cyanide
https://stackoverflow.com/users/2247459/cyanide
Configuration config = getResources().getConfiguration(); if(config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { //in Right To Left layout }
https://stackoverflow.com/a/18996319
Morrison Chang
https://stackoverflow.com/users/295004/morrison-chang
[ 2892885, 1010394, 4604101 ]
[ "https://github.com/skyleet/Android-Projects/blob/2cc574e85323ad00fe6ee0bd5475429c4ae12ea5/material-dialogs-master/core/src/main/java/com/afollestad/materialdialogs/internal/MDRootLayout.java#L361-L374", "https://github.com/open-android/MaterailDialog/blob/9e8f7bff23c53cc56bcb4dfb5c88ed1afa5a39e0/library/src/main/java/com/itheima/materialdialogs/internal/MDRootLayout.java#L369-L382", "https://github.com/AadityaDev/SelfyFever/blob/1fd47f786f14bbbc5c6928cf6c4e3e3ab1cfd4fd/app/src/main/java/com/technawabs/aditya/selfyfever/materialDialog/internal/MDRootLayout.java#L357-L370" ]
8,317,331
Detecting when screen is locked
https://stackoverflow.com/questions/8317331/detecting-when-screen-is-locked
Ryan
https://stackoverflow.com/users/802016/ryan
KeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); if( myKM.inKeyguardRestrictedInputMode()) { //it is locked } else { //it is not locked }
https://stackoverflow.com/a/8668648
Shaul Rosenzweig
https://stackoverflow.com/users/940704/shaul-rosenzweig
[ 384892, 3505974, 3505864 ]
[ "https://github.com/wordpress-mobile/WordPress-Android/blob/20183f7d9bc36bfe8a79e87dd2c1414b5d266f82/libs/utils/WordPressUtils/src/main/java/org/wordpress/android/util/DeviceUtils.java#L95-L98", "https://github.com/wenjiangit/CoolPlayer/blob/744ec08954ea8c03a8e71b48a69f83f78e83805a/common-core/src/main/java/com/wenjian/core/utils/ScreenUtils.java#L158-L161", "https://github.com/wenjiangit/CoolPlayer/blob/744ec08954ea8c03a8e71b48a69f83f78e83805a/base/src/main/java/com/wenjian/base/utils/ScreenUtils.java#L157-L160" ]
19,837,358
Android KitKat securityException when trying to read from MediaStore
https://stackoverflow.com/questions/19837358/android-kitkat-securityexception-when-trying-to-read-from-mediastore
serenskye
https://stackoverflow.com/users/400320/serenskye
i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, CHOOSE_IMAGE);
https://stackoverflow.com/a/20186938
rahulritesh
https://stackoverflow.com/users/1450564/rahulritesh
[ 3142778, 2951256, 4545372 ]
[ "https://github.com/xlagunas/AndRTC/blob/84cf8445b225345f59ad3f24b4b6d78ba2f06322/app/src/main/java/cat/xlagunas/andrtc/view/fragment/UserDetailsRegisterFragment.java#L99-L102", "https://github.com/vrbsm/Pet/blob/9df9bdd8653b7b6919e09be306e59e1998323a76/app/src/main/java/br/org/indt/pets/ui/feed/FeedNewPostFragment.java#L140-L143", "https://github.com/paulofernando/inspirationalpeople/blob/bf07be1b6dd68bf69513cd469819c47bab34fc81/PessoasInspiradoras/app/src/main/java/br/net/paulofernando/pessoasinspiradoras/view/activity/EditPersonActivity.java#L139-L142" ]
9,678,785
android - setting LayoutParams programmatically
https://stackoverflow.com/questions/9678785/android-setting-layoutparams-programmatically
Martin
https://stackoverflow.com/users/815837/martin
tv.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
https://stackoverflow.com/a/9679004
Khan
https://stackoverflow.com/users/1066573/khan
[ 1486052, 1645536, 38430 ]
[ "https://github.com/szpnygo/NoWordsChat/blob/ec93f61e718cb7294303165de9fa96385dcdee8d/app/src/main/java/info/smemo/nowordschat/adapter/SelectImageAdapter.java#L24-L28", "https://github.com/dsolonenko/financisto/blob/a9dd486551dc0b6146f5c04d7cb3e1655c15e908/app/src/main/java/greendroid/widget/QuickActionWidget.java#L107-L111", "https://github.com/alibaba/vlayout/blob/7e08f2e659a64b347a1369314ef81e6adcec2cd5/examples/src/main/java/com/alibaba/android/vlayout/example/DebugActivity.java#L81-L85" ]
20,364,993
Setting textSize programmatically
https://stackoverflow.com/questions/20364993/setting-textsize-programmatically/20365110
Rakeeb Rajbhandari
https://stackoverflow.com/users/2247689/rakeeb-rajbhandari
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.result_font));
https://stackoverflow.com/a/20365110
Geros
https://stackoverflow.com/users/2058133/geros
[ 2532416, 236661, 4584016 ]
[ "https://github.com/santiago-hollmann/igcparser/blob/e970b18fea22738c515d9b49321db6064b8063e3/app/src/main/java/com/shollmann/igcparser/ui/activity/FlightInformationActivity.java#L249-L256", "https://github.com/TeamNewPipe/NewPipe/blob/5c32d73409cff3387cf2baefa498f9c064a2eae8/app/src/main/java/org/schabi/newpipe/util/FilePickerActivityHelper.java#L89-L98", "https://github.com/shubhamiiest/Android/blob/d60b1f7eab2bff0bb6ca1b370bef99f1c0b7d4cd/Iiest_shibpur/facebook/src/com/facebook/widget/LikeView.java#L457-L470" ]
2,601,124
How to obtain MAC address of WiFi network interface?
https://stackoverflow.com/questions/2601124/how-to-obtain-mac-address-of-wifi-network-interface
Gubatron
https://stackoverflow.com/users/188622/gubatron
WifiManager wifiMan = (WifiManager) this.getSystemService( Context.WIFI_SERVICE); WifiInfo wifiInf = wifiMan.getConnectionInfo(); String macAddr = wifiInf.getMacAddress();
https://stackoverflow.com/a/3422452
Tobiaswk
https://stackoverflow.com/users/386683/tobiaswk
[ 2246075, 4082010, 3600840 ]
[ "https://github.com/damian-burke/suddenly-wifi/blob/754e73e9adbaef3a3bb4e59cac175b9ae2cb6f50/app/src/main/java/com/brainasaservice/android/suddenlywifi/activities/NfcActivity.java#L29-L37", "https://github.com/Datatellit/xlight_android_native/blob/681c2e888c88c8a56bdee39cb98a068b70e9144f/app/src/main/java/com/umarbhutta/xlightcompanion/help/DeviceInfo.java#L35-L38", "https://github.com/xiaomochn/Home/blob/25a048cb4db3162919a849e76e9af27c5bab44db/sky/src/main/java/com/tamic/statInterface/statsdk/util/DeviceUtil.java#L79-L83" ]
26,474,125
Android 4.4 translucent Status and Navigation bars style on Android 5.0
https://stackoverflow.com/questions/26474125/android-4-4-translucent-status-and-navigation-bars-style-on-android-5-0
AxeEffect
https://stackoverflow.com/users/372899/axeeffect
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
https://stackoverflow.com/a/26571307
suckgamony
https://stackoverflow.com/users/3162076/suckgamony
[ 1341473, 2293157, 1566209 ]
[ "https://github.com/348476129/LipperJava/blob/96544a45089e25dae1ab13ed581a890245d4c32e/app/src/main/java/com/fallllllll/lipper/utils/MDStatusBarCompat.java#L27-L29", "https://github.com/yuyuyu123/ZCommon/blob/60cf14491f4d3a25060b1c3fd52415b115ea6aea/zcommon/src/main/java/com/cc/android/zcommon/utils/android/StatusBarUtil.java#L146-L149", "https://github.com/TheseYears/CoreLibs/blob/22150ff36195f4921b3f62e65361b7180a747e73/CoreLibs/src/main/java/com/corelibs/base/BaseActivity.java#L223-L227" ]
22,129,420
Canvas: trying to use a recycled bitmap android.graphics.Bitmap in android
https://stackoverflow.com/questions/22129420/canvas-trying-to-use-a-recycled-bitmap-android-graphics-bitmap-in-android
user782104
https://stackoverflow.com/users/782104/user782104
if (mBitmap != null && !mBitmap.isRecycled()) { mBitmap.recycle(); mBitmap = null; }
https://stackoverflow.com/a/22129476
Micer
https://stackoverflow.com/users/1101730/micer
[ 3744280, 3744264, 4483427 ]
[ "https://github.com/PioBeat/RetroGraphicsEngine/blob/c72df6f89aa924d75cd2466869d5935698897b00/src/main/java/net/offbeatpioneer/retroengine/auxiliary/background/ParallaxLayer.java#L54-L57", "https://github.com/PioBeat/RetroGraphicsEngine/blob/c72df6f89aa924d75cd2466869d5935698897b00/src/main/java/net/offbeatpioneer/retroengine/auxiliary/background/FixedScrollableLayer.java#L119-L122", "https://github.com/x13945/Messaging/blob/9625b4ae73e345fe0601d2847ee3e50a0462631e/photoviewer/src/com/android/ex/photo/loaders/PhotoBitmapLoader.java#L168-L172" ]
12,267,572
Mockito + Dexmaker on Android
https://stackoverflow.com/questions/12267572/mockito-dexmaker-on-android
stevo.mit
https://stackoverflow.com/users/1005194/stevo-mit
System.setProperty( "dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath());
https://stackoverflow.com/a/22402631
Adil Hussain
https://stackoverflow.com/users/1071320/adil-hussain
[ 4533673, 580962, 2107032 ]
[ "https://github.com/explodes/testable-android/blob/4fd4fb27b4aac303fb41e5199018e48257914853/app/src/test/java/meta/BaseRoboTest.java#L21-L23", "https://github.com/SilenceIM/Silence/blob/ffcf096d4090fc46a42705705442374987aef7e8/test/androidTest/java/org/smssecure/smssecure/SilenceTestCase.java#L9-L11", "https://github.com/AndroidHardeningArchive/platform_packages_apps_Contacts/blob/4a15b3999291e108a43137c500b286f4c1c1fe87/tests/src/com/android/contacts/model/AccountTypeManagerTest.java#L62-L66" ]
9,294,446
Make new activity appear behind old one during transition
https://stackoverflow.com/questions/9294446/make-new-activity-appear-behind-old-one-during-transition/9296114
johncc
https://stackoverflow.com/users/218464/johncc
startActivity(new Intent(this, Activity2.class)); overridePendingTransition(R.anim.push_down_in,R.anim.push_down_out);
https://stackoverflow.com/a/9296114
Romain Piel
https://stackoverflow.com/users/334209/romain-piel
[ 4332248, 1707717, 3246878 ]
[ "https://github.com/william-taylor-projects/uws-campus-app/blob/aa4666568e08ef9fd364f40e80d461aa2c878cd8/app/app/src/main/java/com/uws/campus_app/core/activity/UwsActivity.java#L23-L26", "https://github.com/vase4kin/TeamCityApp/blob/358ccd4a217d173e28c1da317e56562df551da8d/app/src/main/java/com/github/vase4kin/teamcityapp/account/manage/view/AccountsViewImpl.java#L340-L343", "https://github.com/mufeez-amjad/Connect/blob/c020cd04d30353a43162aab61d09374063de4699/app/src/main/java/amjad/mufeez/connect/Intro.java#L30-L33" ]
5,551,912
android: How to call the number by android application
https://stackoverflow.com/questions/5551912/android-how-to-call-the-number-by-android-application
Hardik Gajjar
https://stackoverflow.com/users/644182/hardik-gajjar
Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:123456789")); startActivity(callIntent);
https://stackoverflow.com/a/5551975
DKIT
https://stackoverflow.com/users/602397/dkit
[ 2664499, 3668757, 3330172 ]
[ "https://github.com/zhaoqp2010/andbase3x/blob/8e5300972667135e3fd1c7b49b4fd60492269067/andbase3x/andbase/src/main/java/com/andbase/library/util/AbAppUtil.java#L643-L647", "https://github.com/maciej-nowak/My-CV/blob/02f62358844e63cc64f6b5c12674b4ed577a1963/app/src/main/java/pl/maciej_nowak/mycv/about/AboutFragment.java#L102-L106", "https://github.com/jesusjimsa/PersonalAssistant-Android-UAIC/blob/877f2e98d776d354eb7f14d8feed4b4d03f01303/app/src/main/java/com/example/jesusjimsa/personalassistant/MainActivity.java#L137-L141" ]
7,308,904
Link should be open in same web view in Android
https://stackoverflow.com/questions/7308904/link-should-be-open-in-same-web-view-in-android
Mahek
https://stackoverflow.com/users/920985/mahek
myWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { view.loadUrl(request.getUrl().toString()); return false; } });
https://stackoverflow.com/a/7309017
momo
https://stackoverflow.com/users/576119/momo
[ 2833061, 3392350, 4330609 ]
[ "https://github.com/thedevelopersanjeev/NewsApp/blob/084188b82682d9982c35f4d46bf9063b7bf86fba/app/src/main/java/com/example/sanjeev/newsapp/NewsDetailView.java#L16-L33", "https://github.com/bluekeroro/PhotoGallery_Challenge_demo/blob/75d7cb100297085512c3c37955d3845a36c0426e/app/src/main/java/com/bluekeroro/android/photogallery/PhotoPageFragment.java#L44-L80", "https://github.com/TinhHuynh/Nekofee/blob/6e56cff2476bfa7a472878a5cc18a94742432534/app/src/main/java/com/huynhtinh/android/nekofee/controler/fragment/WebFragment.java#L50-L98" ]
1,895,206
How can I launch the 'Add Contact' activity in android
https://stackoverflow.com/questions/1895206/how-can-i-launch-the-add-contact-activity-in-android
hap497
https://stackoverflow.com/users/128983/hap497
Intent intent = new Intent(Intent.ACTION_INSERT, ContactsContract.Contacts.CONTENT_URI); startActivity(intent);
https://stackoverflow.com/a/11663568
Vikram Gupta
https://stackoverflow.com/users/1117338/vikram-gupta
[ 2692653, 3856767, 718166 ]
[ "https://github.com/weichweich/AluShare/blob/c74a20dbebd24df1114be1740c1f927c320ade5f/app/src/main/java/edu/kit/tm/pseprak2/alushare/view/CreateContactActivity.java#L89-L93", "https://github.com/HaoMingAh/Android-FCM-Messenger/blob/316462b1764f0584f6a833131ce02d718799d17e/EnigmaMessenger/app/src/main/java/com/jis/enigmamessenger/main/ContactsActivity.java#L137-L142", "https://github.com/AppLozic/Applozic-Android-SDK/blob/ff18be766d4bc9fe9b5c66f2a08db4f8b35abf7b/mobicommons/src/main/java/com/applozic/mobicommons/people/contact/ContactUtils.java#L85-L91" ]
7,328,719
Getting device os version in Android programmatically
https://stackoverflow.com/questions/7328719/getting-device-os-version-in-android-programmatically/43539114
user629872
https://stackoverflow.com/users/629872/user629872
String myVersion = android.os.Build.VERSION.RELEASE; // e.g. myVersion := "1.6" int sdkVersion = android.os.Build.VERSION.SDK_INT; // e.g. sdkVersion := 8;
https://stackoverflow.com/a/7328753
Andrey Atapin
https://stackoverflow.com/users/349820/andrey-atapin
[ 1494891, 4487901, 3066400 ]
[ "https://github.com/The404Hacking/AndroRAT/blob/461ddebeb1f82a99611e961557b414bdd4f626e1/Experiment/AndroratActivity/src/my/app/Library/AdvancedSystemInfo.java#L86-L89", "https://github.com/JuanBGonzalez/U-Business/blob/5e87f76d981b32f680da873e58d6282e8d144abd/app/src/main/java/com/example/juanb/ubusiness/Screens/Activities/DRAWERACT.java#L499-L505", "https://github.com/suncunx/TradeManagement/blob/f455e2192d8ea4f1ee146118b23be98694596e41/CompanyClient/takephoto_library/src/main/java/com/jph/takephoto/uitl/TUtils.java#L167-L181" ]
25,931,334
Send request over Mobile data when WIFI is ON.(Android L)
https://stackoverflow.com/questions/25931334/send-request-over-mobile-data-when-wifi-is-on-android-l/28696825
NitZRobotKoder
https://stackoverflow.com/users/1225076/nitzrobotkoder
builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET); builder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);
https://stackoverflow.com/a/28696825
NitZRobotKoder
https://stackoverflow.com/users/1225076/nitzrobotkoder
[ 3340409, 3427518, 2980113 ]
[ "https://github.com/vintonliu/AppRTCMobile_android/blob/4f0174535e4a7f78545025eff121a6db1c3a9dfe/app/src/main/java/org/webrtc/NetworkMonitorAutoDetect.java#L350-L355", "https://github.com/tc214/AppRTCMobile/blob/5dbf3136edcab92c29b52705ad1b061e794eda56/sdk/android/api/org/webrtc/NetworkMonitorAutoDetect.java#L380-L385", "https://github.com/alexxxdev/packages_apps_Dialer/blob/16a1917119ec2673c5b5a0796316469486312767/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java#L88-L108" ]
23,846,146
What should I pass for root when inflating a layout to use for a MenuItem's ActionView?
https://stackoverflow.com/questions/23846146/what-should-i-pass-for-root-when-inflating-a-layout-to-use-for-a-menuitems-acti
dlf
https://stackoverflow.com/users/3549027/dlf
public MenuItem setActionView(int resId) { final Context context = mMenu.getContext(); final LayoutInflater inflater = LayoutInflater.from(context); setActionView(inflater.inflate(resId, new LinearLayout(context), false)); return this; }
https://stackoverflow.com/a/23847325
Damian Petla
https://stackoverflow.com/users/1456931/damian-petla
[ 2608218, 3106991, 1499407 ]
[ "https://github.com/xmh19936688/LibraryProject/blob/c6d57036bd2d2b7e8a99b06af33a0baa43cd6f07/ActionbarSherlockLibrary/src/com/actionbarsherlock/internal/view/menu/MenuItemImpl.java#L559-L564", "https://github.com/xievxin/GitWorkspace/blob/73fed09827428a104865d980bea5b469dffa52ab/AndroidSource/app/src/main/java/com/android/internal/view/menu/MenuItemImpl.java#L572-L577", "https://github.com/restorer/gloomy-dungeons-2/blob/01145ecac568f8f5c321080ca43368371652dabd/libraries/holoeverywhere/src/android/support/v7/internal/view/menu/MenuItemImpl.java#L613-L618" ]
7,803,256
Android Toast Message is not showing
https://stackoverflow.com/questions/7803256/android-toast-message-is-not-showing
Piraba
https://stackoverflow.com/users/831498/piraba
Toast.makeText(getBaseContext(), "Amount can not be grater than invoice", Toast.LENGTH_SHORT).show();
https://stackoverflow.com/a/7803294
Lalit Poptani
https://stackoverflow.com/users/726863/lalit-poptani
[ 406647, 2880078, 3459041 ]
[ "https://github.com/timusus/Shuttle/blob/53f93c7f955edba730bb83a3def6a5f2005c7b9a/app/src/main/java/com/simplecity/amp_library/playback/MusicService.java#L2716-L2718", "https://github.com/skyleet/Android-Projects/blob/2cc574e85323ad00fe6ee0bd5475429c4ae12ea5/AppIntro-master/example/src/main/java/com/github/paolorotolo/appintroexample/PermissionsIntro.java#L55-L57", "https://github.com/shreyasnbhat/SDPD-Labs/blob/12edb8646013d7c704b55971db984d91d82fc9a2/Map-Sensor/app/src/main/java/com/example/mapdemo/CameraClampingDemoActivity.java#L114-L116" ]

Dataset Card for Neural Code Search

Dataset Summary

Neural-Code-Search-Evaluation-Dataset presents an evaluation dataset consisting of natural language query and code snippet pairs, with the hope that future work in this area can use this dataset as a common benchmark. We also provide the results of two code search models (NCS, UNIF) from recent work.

Supported Tasks and Leaderboards

[More Information Needed]

Languages

EN - English

Dataset Structure

Data Instances

Search Corpus

The search corpus is indexed using all method bodies parsed from the 24,549 GitHub repositories. In total, there are 4,716,814 methods in this corpus. The code search model will find relevant code snippets (i.e. method bodies) from this corpus given a natural language query. In this data release, we will provide the following information for each method in the corpus:

Evaluation Dataset

The evaluation dataset is composed of 287 Stack Overflow question and answer pairs

Data Fields

Search Corpus

  • id: Each method in the corpus has a unique numeric identifier. This ID number will also be referenced in our evaluation dataset.
  • filepath: The file path is in the format of :owner/:repo/relative-file-path-to-the-repo method_name
  • start_line: Starting line number of the method in the file.
  • end_line: Ending line number of the method in the file.
  • url: GitHub link to the method body with commit ID and line numbers encoded.

Evaluation Dataset

  • stackoverflow_id: Stack Overflow post ID.
  • question: Title fo the Stack Overflow post.
  • question_url: URL of the Stack Overflow post.
  • answer: Code snippet answer to the question.

Data Splits

[More Information Needed]

Dataset Creation

Curation Rationale

[More Information Needed]

Source Data

Initial Data Collection and Normalization

The most popular Android repositories on GitHub (ranked by the number of stars) is used to create the search corpus. For each repository that we indexed, we provide the link, specific to the commit that was used.5 In total, there are 24,549 repositories.

Who are the source language producers?

[More Information Needed]

Annotations

Annotation process

[More Information Needed]

Who are the annotators?

[More Information Needed]

Personal and Sensitive Information

[More Information Needed]

Considerations for Using the Data

Social Impact of Dataset

[More Information Needed]

Discussion of Biases

[More Information Needed]

Other Known Limitations

Dataset provided for research purposes only. Please check dataset license for additional information.

Additional Information

Dataset Curators

Hongyu Li, Seohyun Kim and Satish Chandra

Licensing Information

CC-BY-NC 4.0 (Attr Non-Commercial Inter.)

Citation Information

arXiv:1908.09804 [cs.SE]

Contributions

Thanks to @vinaykudari for adding this dataset.

Downloads last month
218