"{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_WEB_SEARCH);\\nintent.putExtra(SearchManager.QUERY, query); \\/\\/ query contains search string\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Start Google search query from activity - Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to resize AlertDialog on the Keyboard display\\n\\nImplementation:\",\"targets\":\"alertDialog.getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to remove drawableleft\\n\\nImplementation:\",\"targets\":\"yourTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\\nyourTextView.setText(\\\"The Text You Need In There\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get the current sqlite database size or package size in Android?\\n\\nImplementation:\",\"targets\":\"File f = context.getDatabasePath(dbName);\\nlong dbSize = f.length();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can I use SensorManager.getOrientation for tilt controls like \\\"My Paper Plane\\\"?\\n\\nImplementation:\",\"targets\":\"if (SensorManager.getRotationMatrix(m_rotationMatrix, null, m_lastAccels, m_lastMagFields)) {\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid google maps marker disable navigation option\\n\\nImplementation:\",\"targets\":\"GoogleMap map;\\nmap.getUiSettings().setMapToolbarEnabled(false);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (mBitmap != null && !mBitmap.isRecycled()) {\\n mBitmap.recycle();\\n mBitmap = null; \\n}\\nDescribe it:\",\"targets\":\"Canvas: trying to use a recycled bitmap android.graphics.Bitmap in android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Start new navigation without exiting from previous navigation in Google Map\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to disable marker click event?\\n\\nImplementation:\",\"targets\":\"map.setOnMarkerClickListener(new OnMarkerClickListener() {\\n @Override\\n public boolean onMarkerClick(Marker marker) {\\n return true;\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nPendingIntent pintent = \\n PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);\\nDescribe it:\",\"targets\":\"Android Status Bar Notifications - Intent getting the old extras on the second time\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nDrawable clone = drawable.getConstantState().newDrawable();\\nDescribe it:\",\"targets\":\"Android: Cloning a drawable in order to make a StateListDrawable with filters\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (Looper.getMainLooper().getThread() == Thread.currentThread()) {\\n \\/\\/ On UI thread.\\n} else {\\n \\/\\/ Not on UI thread.\\n}\\nDescribe it:\",\"targets\":\"How to detect UI thread on Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic static void clearLightStatusBar(@NonNull View view) {\\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\\n int flags = view.getSystemUiVisibility();\\n flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;\\n view.setSystemUiVisibility(flags);\\n }\\n}\\nDescribe it:\",\"targets\":\"Android M Light and Dark status bar programmatically - how to make it dark again?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to add back button arrow functionality in navigation bar\\n\\nImplementation:\",\"targets\":\"@Override\\npublic boolean onOptionsItemSelected(MenuItem item) {\\nswitch (item.getItemId()) {\\n\\/\\/ Respond to the action bar's Up\\/Home button\\ncase android.R.id.home:\\n NavUtils.navigateUpFromSameTask(this);\\n return true;\\n}\\nreturn super.onOptionsItemSelected(item);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to close Android Soft KeyBoard programmatically?\\n\\nImplementation:\",\"targets\":\"\\/\\/to show soft keyboard\\nimm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);\\n\\n\\/\\/to hide it, call the method again\\nimm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent reLaunchMain=new Intent(this,MainActivity.class);\\nreLaunchMain.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nstartActivity(reLaunchMain);\\nDescribe it:\",\"targets\":\"Restarting Android application after process is killed\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic class ShutdownReceiver extends BroadcastReceiver {\\n\\n @Override\\n public void onReceive(Context context, Intent intent) {\\n \\/\\/Insert code here\\n }\\n\\n}\\nDescribe it:\",\"targets\":\"Is there any way to receive a notification when the user powers off the device?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nGlide.with(mContext)\\n .load(url)\\n .diskCacheStrategy(DiskCacheStrategy.SOURCE)\\n .into(imageView);\\nDescribe it:\",\"targets\":\"glide force load cached image, don't care what resolution\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nViewCompat.setImportantForAccessibility(\\n decorativeTextView,\\n ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);\\nDescribe it:\",\"targets\":\"Android - prevent TalkBack from announcing TextView title aloud\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nResources resources = context.getResources();\\nUri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + \\\":\\/\\/\\\" + resources.getResourcePackageName(resId) + '\\/' + resources.getResourceTypeName(resId) + '\\/' + resources.getResourceEntryName(resId) );\\nDescribe it:\",\"targets\":\"Get URI from drawable image\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow do I open the Bluetooth Settings Activity programmatically?\\n\\nImplementation:\",\"targets\":\"Intent intentOpenBluetoothSettings = new Intent();\\nintentOpenBluetoothSettings.setAction(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS); \\nstartActivity(intentOpenBluetoothSettings);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ globally \\nTextView myAwesomeTextView = (TextView)findViewById(R.id.myAwesomeTextView);\\n\\n\\/\\/in your OnCreate() method\\nmyAwesomeTextView.setText(\\\"My Awesome Text\\\");\\nDescribe it:\",\"targets\":\"Android - Set text to TextView\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmyWebView.setWebViewClient(new WebViewClient() {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {\\n view.loadUrl(request.getUrl().toString());\\n return false;\\n }\\n});\\nDescribe it:\",\"targets\":\"Link should be open in same web view in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\npublic boolean onOptionsItemSelected(MenuItem item) {\\nswitch (item.getItemId()) {\\n\\/\\/ Respond to the action bar's Up\\/Home button\\ncase android.R.id.home:\\n NavUtils.navigateUpFromSameTask(this);\\n return true;\\n}\\nreturn super.onOptionsItemSelected(item);\\n}\\nDescribe it:\",\"targets\":\"How to add back button arrow functionality in navigation bar\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSet Title inToolBar from Fragment in Android\\n\\nImplementation:\",\"targets\":\"TextView mTitle = view.findViewById(R.id.toolbar_title);\\n mTitle.setText(\\\"set your title\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){\\n \\/\\/ Do something for lollipop and above versions\\n} else{\\n \\/\\/ do something for phones running an SDK before lollipop\\n}\\nDescribe it:\",\"targets\":\"Retrieving Android API version programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nlvlist.setDivider(null);\\nlvlist.setDividerHeight(0);\\nDescribe it:\",\"targets\":\"How to hide the horizontal line at the bottom of each item in android listview?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"geo:,?q=,(Label+Name)\\\"));\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"How to show marker in Maps launched by geo uri Intent?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (thread.getState() == Thread.State.NEW)\\n{\\n thread.start();\\n}\\nDescribe it:\",\"targets\":\"When I run Thread second time: java.lang.IllegalThreadStateException: Thread already started\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nyourImageView.post(new Runnable() {\\n @Override\\n public void run() {\\n \\/\\/ set the downloaded image here\\n\\n }\\n});\\nDescribe it:\",\"targets\":\"runOnUiThread inside a View\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nGdx.graphics.getWidth();\\nGdx.graphics.getHeight();\\nDescribe it:\",\"targets\":\"How to get screen resolution of an android device using LIBGDX?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nWifiManager wifiMan = (WifiManager) this.getSystemService(\\n Context.WIFI_SERVICE);\\nWifiInfo wifiInf = wifiMan.getConnectionInfo();\\nString macAddr = wifiInf.getMacAddress();\\nDescribe it:\",\"targets\":\"How to obtain MAC address of WiFi network interface?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n((ViewGroup)scrollChildLayout.getParent()).removeView(scrollChildLayout);\\n\\/\\/scrollView.removeView(scrollChildLayout);\\nDescribe it:\",\"targets\":\"Call removeView() on the child's parent first\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nUsing full screen Activity\\n\\nImplementation:\",\"targets\":\"getWindow().getDecorView().setSystemUiVisibility(\\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\\n| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\\n| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\\n| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\\n| View.SYSTEM_UI_FLAG_FULLSCREEN\\n| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSoftKeyboard open and close listener in an activity in Android?\\n\\nImplementation:\",\"targets\":\"yourEditText.setOnFocusChangeListener(new OnFocusChangeListener() {\\n@Override\\npublic void onFocusChange(View v, boolean hasFocus) {\\n if (hasFocus) {\\n \\/\\/got focus\\n } else {\\n \\/\\/lost focus\\n }\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Google Sign In: check if User is signed in\\n\\nImplementation:\",\"targets\":\"if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {\\n \\/\\/ signed in. Show the \\\"sign out\\\" button and explanation.\\n \\/\\/ ...\\n} else {\\n \\/\\/ not signed in. Show the \\\"sign in\\\" button and explanation.\\n \\/\\/ ...\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDon't display the overlay with the Android Navigation Drawer\\n\\nImplementation:\",\"targets\":\"mDrawerLayout.setScrimColor(Color.WHITE);\\n\\/\\/ OR\\nmDrawerLayout.setScrimColor(Color.TRANSPARENT);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid KitKat securityException when trying to read from MediaStore\\n\\nImplementation:\",\"targets\":\"i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\\nstartActivityForResult(i, CHOOSE_IMAGE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCalling startActivity() from outside of an Activity?\\n\\nImplementation:\",\"targets\":\"Intent i = new Intent(this, Wakeup.class);\\ni.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntry {\\n Class.forName( \\\"your.fqdn.class.name\\\" );\\n} catch( ClassNotFoundException e ) {\\n \\/\\/my class isn't there!\\n}\\nDescribe it:\",\"targets\":\"How to check if class exists somewhere in package?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent i = new Intent(this, NewlyStartedActivity.class);\\nstartActivity(i);\\noverridePendingTransition(R.anim.fade_in, R.anim.fade_out);\\nDescribe it:\",\"targets\":\"How to perform a fade animation on Activity transition?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"tg:\\/\\/resolve?domain=partsilicon\\\"));\\n startActivity(intent);\\nDescribe it:\",\"targets\":\"Open telegram channel in android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to check if class exists somewhere in package?\\n\\nImplementation:\",\"targets\":\"try {\\n Class.forName( \\\"your.fqdn.class.name\\\" );\\n} catch( ClassNotFoundException e ) {\\n \\/\\/my class isn't there!\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to start an Activity with an animation set entirely programmatically\\n\\nImplementation:\",\"targets\":\"startActivity(intent);\\n\\noverridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntextView.setTextSize(TypedValue.COMPLEX_UNIT_PX,\\n getResources().getDimension(R.dimen.textsize));\\nDescribe it:\",\"targets\":\"How to set text size of textview dynamically for different screens\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nRestarting Android application after process is killed\\n\\nImplementation:\",\"targets\":\"Intent reLaunchMain=new Intent(this,MainActivity.class);\\nreLaunchMain.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nstartActivity(reLaunchMain);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetResources().getInteger(android.R.integer.config_shortAnimTime);\\ngetResources().getInteger(android.R.integer.config_mediumAnimTime);\\ngetResources().getInteger(android.R.integer.config_longAnimTime);\\nDescribe it:\",\"targets\":\"What are the actual ms time values for Android's animTime constants?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nwebView.setWebViewClient(new WebViewClient(){\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n return true;\\n }\\n});\\nDescribe it:\",\"targets\":\"Don't navigate to other pages in WebView,disable links and references\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nError getting window size on android: \\\"The method getWindowManager is undefined\\\"\\n\\nImplementation:\",\"targets\":\"((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE))\\n .getDefaultDisplay().getMetrics(metrics);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to set text size of textview dynamically for different screens\\n\\nImplementation:\",\"targets\":\"textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,\\n getResources().getDimension(R.dimen.textsize));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nClose android application programmatically\\n\\nImplementation:\",\"targets\":\"getActivity().finish();\\nSystem.exit(0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (keepScreenOn)\\n getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\\nelse\\n getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\\nDescribe it:\",\"targets\":\"How to prevent the screen of an android device to turn off during the execution of an Activity?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nscrollView.setOnTouchListener(new View.OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/ TODO Auto-generated method stub\\n return isBlockedScrollView;\\n }\\n });\\nDescribe it:\",\"targets\":\"Disable ScrollView Programmatically?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nprivate int fetchAccentColor() {\\n TypedValue typedValue = new TypedValue();\\n\\n TypedArray a = mContext.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent });\\n int color = a.getColor(0, 0);\\n\\n a.recycle();\\n\\n return color;\\n}\\nDescribe it:\",\"targets\":\"How to get accent color programmatically?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: How to rotate a bitmap on a center point\\n\\nImplementation:\",\"targets\":\"public static Bitmap RotateBitmap(Bitmap source, float angle)\\n{\\n Matrix matrix = new Matrix();\\n matrix.postRotate(angle);\\n return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nXAxis xAxis = chart.getXAxis();\\nxAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\\nDescribe it:\",\"targets\":\"MPAndroidChart: bottom x-axis and multiple y-axes\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nUncheck all RadioButton in a RadioButtonGroup\\n\\nImplementation:\",\"targets\":\"RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radiogroup);\\nradioGroup.clearCheck();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to 'restart' an android application programmatically\\n\\nImplementation:\",\"targets\":\"Intent i = getBaseContext().getPackageManager()\\n .getLaunchIntentForPackage( getBaseContext().getPackageName() );\\ni.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nRecyclerView.Adapter.notifyItemChanged() never passes payload to onBindViewHolder()\\n\\nImplementation:\",\"targets\":\"DefaultItemAnimator animator = new DefaultItemAnimator() {\\n @Override\\n public boolean canReuseUpdatedViewHolder(RecyclerView.ViewHolder viewHolder) {\\n return true;\\n }\\n };\\nmRecyclerView.setItemAnimator(animator);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString sql = \\\"DELETE FROM myTable WHERE Save_Date <= date('now','-2 day')\\\"; \\ndb.execSQL(sql);\\nDescribe it:\",\"targets\":\"deleting android sqllite rows older than x days\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: How to scroll ScrollView in top\\n\\nImplementation:\",\"targets\":\"scrollViewEventDetails.fullScroll(View.FOCUS_UP);\\/\\/if you move at the end of the scroll\\n\\nscrollViewEventDetails.pageScroll(View.FOCUS_UP);\\/\\/if you move at the middle of the scroll\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nShowing the soft keyboard for SearchView on ActionBar\\n\\nImplementation:\",\"targets\":\"((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).\\n toggleSoftInput(InputMethodManager.SHOW_FORCED,\\n InputMethodManager.HIDE_IMPLICIT_ONLY);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nBack button and refreshing previous activity\\n\\nImplementation:\",\"targets\":\"@Override\\npublic void onRestart() { \\n super.onRestart();\\n \\/\\/When BACK BUTTON is pressed, the activity on the stack is restarted\\n \\/\\/Do what you want on the refresh procedure here\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString url = \\\"http:\\/\\/www.YOUR-URL.com\\\";\\nIntent i = new Intent(Intent.ACTION_VIEW);\\ni.setData(Uri.parse(url));\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"Easiest way to launch webpage in android with an icon\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nFramework7 inside webview pages not loading\\n\\nImplementation:\",\"targets\":\"webSettings.setAllowFileAccessFromFileURLs(true);\\nwebSettings.setAllowUniversalAccessFromFileURLs(true);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nNavigation drawer menu icon is not displayed correctly\\n\\nImplementation:\",\"targets\":\"NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);\\n navigationView.setItemIconTintList(null);\\n navigationView.setNavigationItemSelectedListener(this);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nPush up content when clicking in edit text\\n\\nImplementation:\",\"targets\":\"getActivity().getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent startMain = new Intent(Intent.ACTION_MAIN);\\n startMain.addCategory(Intent.CATEGORY_HOME);\\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\n startActivity(startMain);\\nDescribe it:\",\"targets\":\"How to Launch Home Screen Programmatically in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic class MyDialog extends Activity {\\n @Override\\n public void onCreate(Bundle savedInstanceState) {\\n super.onCreate(savedInstanceState);\\n final AlertDialog alertDialog = new AlertDialog.Builder(this).create();\\n alertDialog.setTitle(\\\"your title\\\");\\n alertDialog.setMessage(\\\"your message\\\");\\n alertDialog.setIcon(R.drawable.icon);\\n\\n alertDialog.show();\\n }\\n}\\nDescribe it:\",\"targets\":\"Android Alert dialog from inside an intent service\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nvoid someMethodThatUsesActivity(Activity myActivityReference) {\\n myActivityReference.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\\n}\\nDescribe it:\",\"targets\":\"How to call getWindow() outside an Activity in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nOpen telegram channel in android\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"tg:\\/\\/resolve?domain=partsilicon\\\"));\\n startActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSwipeRefreshLayout trigger programmatically\\n\\nImplementation:\",\"targets\":\"mSwipeRefreshLayout.post(new Runnable() {\\n @Override\\n public void run() {\\n mSwipeRefreshLayout.setRefreshing(true);\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid set button background programmatically\\n\\nImplementation:\",\"targets\":\"\\/\\/ If you're in an activity:\\nButton11.setBackgroundColor(getResources().getColor(R.color.red));\\n\\/\\/ OR, if you're not: \\nButton11.setBackgroundColor(Button11.getContext().getResources().getColor(R.color.red));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nDescribe it:\",\"targets\":\"Resume the Activity instead of Starting if already exists in back stack\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/**\\n* Gets the state of Airplane Mode.\\n* \\n* @param context\\n* @return true if enabled.\\n*\\/\\nprivate static boolean isAirplaneModeOn(Context context) {\\n\\n return Settings.System.getInt(context.getContentResolver(),\\n Settings.System.AIRPLANE_MODE_ON, 0) != 0;\\n\\n}\\nDescribe it:\",\"targets\":\"How can one detect airplane mode on Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nsendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(\\\"file:\\/\\/\\\"\\n + Environment.getExternalStorageDirectory())));\\nDescribe it:\",\"targets\":\"Android How to use MediaScannerConnection scanFile\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(android.os.Build.VERSION.SDK_INT >= 14) {\\n \\/\\/ Do something fancy\\n}\\nelse {\\n \\/\\/ Do something regular\\n}\\nDescribe it:\",\"targets\":\"Higher API calls when lower SDK targeted\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString url = \\\"http:\\/\\/www.twitter.com\\/intent\\/tweet?url=YOURURL&text=YOURTEXT\\\";\\nIntent i = new Intent(Intent.ACTION_VIEW);\\ni.setData(Uri.parse(url));\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"How can I post on Twitter with Intent Action_send?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Alert dialog from inside an intent service\\n\\nImplementation:\",\"targets\":\"public class MyDialog extends Activity {\\n @Override\\n public void onCreate(Bundle savedInstanceState) {\\n super.onCreate(savedInstanceState);\\n final AlertDialog alertDialog = new AlertDialog.Builder(this).create();\\n alertDialog.setTitle(\\\"your title\\\");\\n alertDialog.setMessage(\\\"your message\\\");\\n alertDialog.setIcon(R.drawable.icon);\\n\\n alertDialog.show();\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nglide force load cached image, don't care what resolution\\n\\nImplementation:\",\"targets\":\"Glide.with(mContext)\\n .load(url)\\n .diskCacheStrategy(DiskCacheStrategy.SOURCE)\\n .into(imageView);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmDrawerLayout.setScrimColor(Color.WHITE);\\n\\/\\/ OR\\nmDrawerLayout.setScrimColor(Color.TRANSPARENT);\\nDescribe it:\",\"targets\":\"Don't display the overlay with the Android Navigation Drawer\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSwipeRefreshLayout setRefreshing() not showing indicator initially\\n\\nImplementation:\",\"targets\":\"mSwipeRefreshLayout.post(new Runnable() {\\n @Override\\n public void run() {\\n mSwipeRefreshLayout.setRefreshing(true);\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSecond AsyncTask not executing\\n\\nImplementation:\",\"targets\":\"if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\\n task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\\n} else {\\n task.execute();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nView view = (View) LayoutInflater.from(ctx).inflate(R.layout.preference_report_bug_layout, null);\\nEditText editText = view.findViewById(R.id.bug_description_edittext);\\nbuilder.setView(view);\\nDescribe it:\",\"targets\":\"How to get elements(findViewById) for a layout which is dynamically loaded(setView) in a dialog?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ map is a GoogleMap object\\nmap.setMyLocationEnabled(true);\\nDescribe it:\",\"targets\":\"How to display my location on Google Maps for Android API v2\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nOpen url with an browser\\n\\nImplementation:\",\"targets\":\"Intent intent= new Intent(Intent.ACTION_VIEW,Uri.parse(YOUR_URL));\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent browserIntent = new Intent(Intent.ACTION_VIEW,\\n Uri.parse(\\\"https:\\/\\/play.google.com\\/store\\/account\\\"));\\n startActivity(browserIntent);\\nDescribe it:\",\"targets\":\"Redirect user to the Subscription page in the playstore\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid: Softkeyboard perform action when Done key is pressed\\n\\nImplementation:\",\"targets\":\"editText.setOnEditorActionListener(new OnEditorActionListener() { \\n @Override\\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\\n if(actionId==EditorInfo.IME_ACTION_DONE){\\n \\/\\/do something\\n }\\n return false;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmRecyclerView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {\\n @Override\\n\\npublic void onLayoutChange(View v, int left, int top, int right,int bottom, int oldLeft, int oldTop,int oldRight, int oldBottom)\\n{\\n\\nmRecyclerView.scrollToPosition(mMessages.size()-1);\\n\\n}\\n });\\nDescribe it:\",\"targets\":\"How to push recylerView up when keyboard appear?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Layout make all children's not clickable\\n\\nImplementation:\",\"targets\":\"YOUR_RELATIVE_LAYOUT.setOnTouchListener(new OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/ ignore all touch events\\n return true;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to kill an application with all its activities?\\n\\nImplementation:\",\"targets\":\"@Override\\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\\n switch(resultCode)\\n {\\n case RESULT_CLOSE_ALL:\\n setResult(RESULT_CLOSE_ALL);\\n finish();\\n }\\n super.onActivityResult(requestCode, resultCode, data);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic boolean onItemLongClick(AdapterView parent, View view, int position, long id) { \\n return true;\\n}\\nDescribe it:\",\"targets\":\"How to prevent OnItemClickListener work when long click performed?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(getResources().getBoolean(R.bool.portrait_only)){\\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\\n }\\nDescribe it:\",\"targets\":\"Android: allow portrait and landscape for tablets, but force portrait on phone?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid - Simulate Home click\\n\\nImplementation:\",\"targets\":\"Intent i = new Intent(Intent.ACTION_MAIN);\\ni.addCategory(Intent.CATEGORY_HOME);\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ If you're in an activity:\\nButton11.setBackgroundColor(getResources().getColor(R.color.red));\\n\\/\\/ OR, if you're not: \\nButton11.setBackgroundColor(Button11.getContext().getResources().getColor(R.color.red));\\nDescribe it:\",\"targets\":\"android set button background programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nhow to make edittext field for decimals\\n\\nImplementation:\",\"targets\":\"et.setInputType(InputType.TYPE_CLASS_NUMBER \\n | InputType.TYPE_NUMBER_FLAG_DECIMAL);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to perform a fade animation on Activity transition?\\n\\nImplementation:\",\"targets\":\"Intent i = new Intent(this, NewlyStartedActivity.class);\\nstartActivity(i);\\noverridePendingTransition(R.anim.fade_in, R.anim.fade_out);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ Check if no view has focus:\\nView view = this.getCurrentFocus();\\nif (view != null) { InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0);}\\nDescribe it:\",\"targets\":\"Close\\/hide the Android Soft Keyboard\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().getDecorView().setSystemUiVisibility(\\n View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\\nDescribe it:\",\"targets\":\"Android 4.4 translucent Status and Navigation bars style on Android 5.0\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHigher API calls when lower SDK targeted\\n\\nImplementation:\",\"targets\":\"if(android.os.Build.VERSION.SDK_INT >= 14) {\\n \\/\\/ Do something fancy\\n}\\nelse {\\n \\/\\/ Do something regular\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nUsing ProgressDialog in ActionBar (Android)\\n\\nImplementation:\",\"targets\":\"requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); \\nsetProgressBarIndeterminateVisibility(true);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nWhat are the actual ms time values for Android's animTime constants?\\n\\nImplementation:\",\"targets\":\"getResources().getInteger(android.R.integer.config_shortAnimTime);\\ngetResources().getInteger(android.R.integer.config_mediumAnimTime);\\ngetResources().getInteger(android.R.integer.config_longAnimTime);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMake new activity appear behind old one during transition\\n\\nImplementation:\",\"targets\":\"startActivity(new Intent(this, Activity2.class));\\noverridePendingTransition(R.anim.push_down_in,R.anim.push_down_out);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to query for the default SpeechRecognizer\\n\\nImplementation:\",\"targets\":\"String serviceComponent = Settings.Secure.getString(mContext.getContentResolver(),\\n \\\"voice_recognition_service\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nSettings.System.putInt(getContentResolver(), \\n Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);\\nDescribe it:\",\"targets\":\"How can we turn automatic brightness off in android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nCameraUpdate center=\\n CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044,\\n -73.98180484771729));\\n CameraUpdate zoom=CameraUpdateFactory.zoomTo(15);\\n\\n map.moveCamera(center);\\n map.animateCamera(zoom);\\nDescribe it:\",\"targets\":\"Google Maps v2 - set both my location and zoom in\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic class WifiReceiver extends BroadcastReceiver {\\n\\n @Override\\n public void onReceive(Context context, Intent intent) { \\n ConnectivityManager conMan = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); \\n NetworkInfo netInfo = conMan.getActiveNetworkInfo();\\n if (netInfo != null && netInfo.getType() == ConnectivityManager.TYPE_WIFI) \\n Log.d(\\\"WifiReceiver\\\", \\\"Have Wifi Connection\\\");\\n else\\n Log.d(\\\"WifiReceiver\\\", \\\"Don't have Wifi Connection\\\"); \\n } \\n};\\nDescribe it:\",\"targets\":\"Wifi Connect-Disconnect Listener\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\\n switch(resultCode)\\n {\\n case RESULT_CLOSE_ALL:\\n setResult(RESULT_CLOSE_ALL);\\n finish();\\n }\\n super.onActivityResult(requestCode, resultCode, data);\\n}\\nDescribe it:\",\"targets\":\"How to kill an application with all its activities?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to kill my own Activity - the hard way\\n\\nImplementation:\",\"targets\":\"public void onDestroy() {\\n super.onDestroy();\\n android.os.Process.killProcess(android.os.Process.myPid());\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic boolean isColorDark(int color){\\n double darkness = 1-(0.299*Color.red(color) + 0.587*Color.green(color) + 0.114*Color.blue(color))\\/255;\\n if(darkness<0.5){\\n return false; \\/\\/ It's a light color\\n }else{\\n return true; \\/\\/ It's a dark color\\n }\\n}\\nDescribe it:\",\"targets\":\"Check if color is dark or light in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent= new Intent(Intent.ACTION_VIEW,Uri.parse(YOUR_URL));\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Open url with an browser\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent callIntent = new Intent(Intent.ACTION_CALL);\\n callIntent.setData(Uri.parse(\\\"tel:123456789\\\"));\\n startActivity(callIntent);\\nDescribe it:\",\"targets\":\"make a phone call click on a button\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetActivity().getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);\\nDescribe it:\",\"targets\":\"Push up content when clicking in edit text\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid VideoView repetition\\n\\nImplementation:\",\"targets\":\"myVideoView.setOnPreparedListener(new OnPreparedListener() {\\n\\n @Override\\n public void onPrepared(MediaPlayer mp) {\\n \\/\\/ TODO Auto-generated method stub\\n mp.setLooping(true);\\n\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic class MVAccelerateDecelerateInterpolator implements Interpolator {\\n\\n \\/\\/ easeInOutQuint\\n public float getInterpolation(float t) {\\n float x = t*2.0f;\\n if (t<0.5f) return 0.5f*x*x*x*x*x;\\n x = (t-0.5f)*2-1;\\n return 0.5f*x*x*x*x*x+1;\\n }\\n}\\nDescribe it:\",\"targets\":\"Custom android AccelerateDecelerateInterpolator\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nstartActivity(new Intent(this, Activity2.class));\\noverridePendingTransition(R.anim.push_down_in,R.anim.push_down_out);\\nDescribe it:\",\"targets\":\"Make new activity appear behind old one during transition\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDetecting when screen is locked\\n\\nImplementation:\",\"targets\":\"KeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\\nif( myKM.inKeyguardRestrictedInputMode()) {\\n \\/\\/it is locked\\n} else {\\n \\/\\/it is not locked\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nOnScreen keyboard opens automatically when Activity starts\\n\\nImplementation:\",\"targets\":\"getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nSoapPrimitive result = (SoapPrimitive)envelope.getResponse();\\nString strRes = result.toString();\\nDescribe it:\",\"targets\":\"How to call a .NET Webservice from Android using KSOAP2?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\ndismiss the popup window by back button\\n\\nImplementation:\",\"targets\":\"if(popup!=null){\\n \\/\\/dismiss the popup\\n popup.dismiss();\\n \\/\\/make popup null again\\n popup=null;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nReliably get height of status bar to solve KitKat translucent navigation issue\\n\\nImplementation:\",\"targets\":\"public int getStatusBarHeight() {\\n int result = 0;\\n int resourceId = getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resourceId > 0) {\\n result = getResources().getDimensionPixelSize(resourceId);\\n }\\n return result;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic boolean isOnline() {\\n ConnectivityManager cm =\\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\\n return netInfo != null && netInfo.isConnectedOrConnecting();\\n}\\nDescribe it:\",\"targets\":\"How to check internet access on Android? InetAddress never times out\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\neditText.setOnEditorActionListener(new OnEditorActionListener() { \\n @Override\\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\\n if(actionId==EditorInfo.IME_ACTION_DONE){\\n \\/\\/do something\\n }\\n return false;\\n }\\n});\\nDescribe it:\",\"targets\":\"android: Softkeyboard perform action when Done key is pressed\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nEasiest way to launch webpage in android with an icon\\n\\nImplementation:\",\"targets\":\"String url = \\\"http:\\/\\/www.YOUR-URL.com\\\";\\nIntent i = new Intent(Intent.ACTION_VIEW);\\ni.setData(Uri.parse(url));\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nnotificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP\\n |Intent.FLAG_ACTIVITY_SINGLE_TOP);\\nDescribe it:\",\"targets\":\"Click on notification starts activity twice\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid: How to call the number by android application\\n\\nImplementation:\",\"targets\":\"Intent callIntent = new Intent(Intent.ACTION_CALL);\\ncallIntent.setData(Uri.parse(\\\"tel:123456789\\\"));\\nstartActivity(callIntent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to check internet access on Android? InetAddress never times out\\n\\nImplementation:\",\"targets\":\"public boolean isOnline() {\\n ConnectivityManager cm =\\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\\n return netInfo != null && netInfo.isConnectedOrConnecting();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent i = getBaseContext().getPackageManager()\\n .getLaunchIntentForPackage( getBaseContext().getPackageName() );\\ni.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"How to 'restart' an android application programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDrag & Drop Espresso\\n\\nImplementation:\",\"targets\":\"public static ViewAction swipeUp() { \\nreturn new GeneralSwipeAction(Swipe.FAST, GeneralLocation.BOTTOM_CENTER, \\n GeneralLocation.TOP_CENTER, Press.FINGER); \\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nrunOnUiThread inside a View\\n\\nImplementation:\",\"targets\":\"yourImageView.post(new Runnable() {\\n @Override\\n public void run() {\\n \\/\\/ set the downloaded image here\\n\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to hide the horizontal line at the bottom of each item in android listview?\\n\\nImplementation:\",\"targets\":\"lvlist.setDivider(null);\\nlvlist.setDividerHeight(0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nConfiguration config = getResources().getConfiguration();\\nif(config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {\\n \\/\\/in Right To Left layout\\n}\\nDescribe it:\",\"targets\":\"Identifying RTL language in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nYOUR_RELATIVE_LAYOUT.setOnTouchListener(new OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/ ignore all touch events\\n return true;\\n }\\n});\\nDescribe it:\",\"targets\":\"Android Layout make all children's not clickable\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString url = \\\"http:\\/\\/www.example.com\\\";\\nIntent i = new Intent(Intent.ACTION_VIEW);\\ni.setData(Uri.parse(url));\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"Sending an Intent to browser to open specific URL\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.HONEYCOMB) {\\n \\/\\/ call something for API Level 11+\\n}\\nDescribe it:\",\"targets\":\"How do I check HoneyComb or higher is running, and accordingly call a method for that Version?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|\\n WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|\\n WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|\\n WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);\\nDescribe it:\",\"targets\":\"Android activity over default lock screen\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmyButton.setBackgroundColor(Color.parseColor(\\\"#RRGGBB\\\"));\\nDescribe it:\",\"targets\":\"How to access drawable resources (color) in java\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to display my location on Google Maps for Android API v2\\n\\nImplementation:\",\"targets\":\"\\/\\/ map is a GoogleMap object\\nmap.setMyLocationEnabled(true);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nCrashlyticsCore core = new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build();\\nFabric.with(this, new Crashlytics.Builder().core(core).build());\\nDescribe it:\",\"targets\":\"Crashlytics deprecated method disabled()\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nProgramatically set '?selectableItemBackground' on Android view\\n\\nImplementation:\",\"targets\":\"TypedValue outValue = new TypedValue();\\ngetContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);\\ncardView.setBackgroundResource(outValue.resourceId);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmViewPager = (ViewPager)findViewById(R.id.pager);\\nmViewPager.setOffscreenPageLimit(2);\\nDescribe it:\",\"targets\":\"Prevent ViewPager from destroying off-screen views\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nForce application to restart on first activity\\n\\nImplementation:\",\"targets\":\"Intent i = getBaseContext().getPackageManager()\\n .getLaunchIntentForPackage( getBaseContext().getPackageName() );\\ni.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to Launch Home Screen Programmatically in Android\\n\\nImplementation:\",\"targets\":\"Intent startMain = new Intent(Intent.ACTION_MAIN);\\n startMain.addCategory(Intent.CATEGORY_HOME);\\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\n startActivity(startMain);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: ScrollView force to bottom\\n\\nImplementation:\",\"targets\":\"scroll.post(new Runnable() { \\n @Override\\n public void run() {\\n scroll.fullScroll(View.FOCUS_DOWN); \\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSetting WebView to view Desktop Site and Not Mobile Site\\n\\nImplementation:\",\"targets\":\"String newUA= \\\"Mozilla\\/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko\\/20100101 Firefox\\/4.0\\\";\\n mWebView.getSettings().setUserAgentString(newUA);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAdding titles to ViewPager\\n\\nImplementation:\",\"targets\":\"statePagerAdapter = new FragmentStatePagerAdapter(fragmentManager) {\\n @Override\\n public CharSequence getPageTitle(int position) {\\n return \\\"Title Here\\\";\\n }\\n};\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE))\\n .getDefaultDisplay().getMetrics(metrics);\\nDescribe it:\",\"targets\":\"Error getting window size on android: \\\"The method getWindowManager is undefined\\\"\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHide status bar android\\n\\nImplementation:\",\"targets\":\"requestWindowFeature(Window.FEATURE_NO_TITLE);\\/\\/ hide statusbar of Android\\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nInputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\\nimm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);\\nDescribe it:\",\"targets\":\"How to remove auto focus\\/keyboard popup of a field when the screen shows up?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nSnackbar snack = Snackbar.make(findViewById(R.id.coordinatorLayout),\\n \\\"Your message\\\", Snackbar.LENGTH_LONG);\\nCoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams)\\nsnack.getView().getLayoutParams();\\nparams.setMargins(leftMargin, topMargin, rightMargin, bottomBar.height);\\nsnack.getView().setLayoutParams(params);\\nsnack.show();\\nDescribe it:\",\"targets\":\"Move snackbar above the bottom bar\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nTextView mTitle = view.findViewById(R.id.toolbar_title);\\n mTitle.setText(\\\"set your title\\\");\\nDescribe it:\",\"targets\":\"Set Title inToolBar from Fragment in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nEnd animation event android\\n\\nImplementation:\",\"targets\":\"anim.setAnimationListener(new Animation.AnimationListener(){\\n @Override\\n public void onAnimationStart(Animation arg0) {\\n } \\n @Override\\n public void onAnimationRepeat(Animation arg0) {\\n } \\n @Override\\n public void onAnimationEnd(Animation arg0) {\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can we turn automatic brightness off in android?\\n\\nImplementation:\",\"targets\":\"Settings.System.putInt(getContentResolver(), \\n Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to add a line break in an Android TextView?\\n\\nImplementation:\",\"targets\":\"String s = \\\"Line 1\\\"\\n + System.getProperty (\\\"line.separator\\\")\\n + \\\"Line 2\\\"\\n + System.getProperty (\\\"line.separator\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nBufferedReader r = new BufferedReader(new InputStreamReader(inputStream));\\nStringBuilder total = new StringBuilder();\\nString line;\\nwhile ((line = r.readLine()) != null) {\\n total.append(line).append('\\\\n');\\n}\\nDescribe it:\",\"targets\":\"Android Reading from an Input stream efficiently\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ndialog.setOnCancelListener(new DialogInterface.OnCancelListener() { \\n @Override\\n public void onCancel(DialogInterface dialog) {\\n \\/\\/do whatever you want the back key to do\\n }\\n});\\nDescribe it:\",\"targets\":\"How to handle Back button with in the dialog?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\ndeleting android sqllite rows older than x days\\n\\nImplementation:\",\"targets\":\"String sql = \\\"DELETE FROM myTable WHERE Save_Date <= date('now','-2 day')\\\"; \\ndb.execSQL(sql);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid WebView click open within WebView not a default browser\\n\\nImplementation:\",\"targets\":\"this.mWebView.setWebViewClient(new WebViewClient(){\\n\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url){\\n view.loadUrl(url);\\n return true;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nKeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\\nif( myKM.inKeyguardRestrictedInputMode()) {\\n \\/\\/it is locked\\n} else {\\n \\/\\/it is not locked\\n}\\nDescribe it:\",\"targets\":\"Detecting when screen is locked\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/noinspection ResourceType\\nUsageStatsManager usageStatsManager=(UsageStatsManager)context.getSystemService(\\\"usagestats\\\");\\nDescribe it:\",\"targets\":\"Cannot use getSystemService(\\\"usagestats\\\") Android Studio\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow do I restart an Android Activity\\n\\nImplementation:\",\"targets\":\"Intent intent = getIntent();\\nfinish();\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = getIntent();\\nfinish();\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"how do I restart an activity in android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetActivity().getActionBar().setDisplayOptions(\\n ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);\\nDescribe it:\",\"targets\":\"Restore default actionbar layout\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to detect UI thread on Android?\\n\\nImplementation:\",\"targets\":\"if (Looper.getMainLooper().getThread() == Thread.currentThread()) {\\n \\/\\/ On UI thread.\\n} else {\\n \\/\\/ Not on UI thread.\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to obtain MAC address of WiFi network interface?\\n\\nImplementation:\",\"targets\":\"WifiManager wifiMan = (WifiManager) this.getSystemService(\\n Context.WIFI_SERVICE);\\nWifiInfo wifiInf = wifiMan.getConnectionInfo();\\nString macAddr = wifiInf.getMacAddress();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to use Room Persistence Library with pre-populated database?\\n\\nImplementation:\",\"targets\":\"Room.databaseBuilder(context.getApplicationContext(), \\n AppDatabase.class, \\n \\\"database_name.db\\\")\\n.openHelperFactory(new AssetSQLiteOpenHelperFactory())\\n.allowMainThreadQueries()\\n.build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to Inflate view from XML in Android?\\n\\nImplementation:\",\"targets\":\"LayoutInflater inflater = (LayoutInflater)getApplicationContext().getSystemService\\n (Context.LAYOUT_INFLATER_SERVICE);\\nView view = inflater.inflate(R.layout.new_layout,null);\\nmain.addView(view);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetSupportActionBar().hide(); \\/\\/ for hiding\\ngetSupportActionBar().show(); \\/\\/ for showing\\nDescribe it:\",\"targets\":\"How To Show and hide ActionBar with AppCompat v.7\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent();\\nintent.setType(\\\"image\\/*\\\");\\nintent.setAction(Intent.ACTION_GET_CONTENT);\\nstartActivityForResult(Intent.createChooser(intent, \\\"Select Picture\\\"),SELECT_IMAGE);\\nDescribe it:\",\"targets\":\"How to open phones gallery through code\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_MAIN);\\nintent.addCategory(Intent.CATEGORY_HOME);\\nintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"How to exit from the application and show the home screen?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to Retrieve Text from Textbox in Android widget?\\n\\nImplementation:\",\"targets\":\"EditText editText = (EditText)findViewById(R.id.yourId);\\nString editTextStr = editText.getText().toString();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic int getStatusBarHeight() {\\n int result = 0;\\n int resourceId = getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resourceId > 0) {\\n result = getResources().getDimensionPixelSize(resourceId);\\n }\\n return result;\\n}\\nDescribe it:\",\"targets\":\"Reliably get height of status bar to solve KitKat translucent navigation issue\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRetrofit retrofit = new Retrofit.Builder()\\n .baseUrl(\\\"**sample base url here**\\\")\\n .addConverterFactory(GsonConverterFactory.create())\\n .build();\\nDescribe it:\",\"targets\":\"Unable to create converter for my class in Android Retrofit library\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to set View alpha in lower Api than 11?\\n\\nImplementation:\",\"targets\":\"if (Build.VERSION.SDK_INT < 11) {\\n final AlphaAnimation animation = new AlphaAnimation(alpha, alpha);\\n animation.setDuration(duration);\\n animation.setFillAfter(true);\\n view.startAnimation(animation);\\n} else {\\n view.setAlpha(alpha);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nToast.makeText(getBaseContext(), \\\"Amount can not be grater than invoice\\\",\\n Toast.LENGTH_SHORT).show();\\nDescribe it:\",\"targets\":\"Android Toast Message is not showing\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\net.setInputType(InputType.TYPE_CLASS_NUMBER \\n | InputType.TYPE_NUMBER_FLAG_DECIMAL);\\nDescribe it:\",\"targets\":\"how to make edittext field for decimals\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nint flags = textView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG\\n | Paint.ANTI_ALIAS_FLAG;\\ntextView.setPaintFlags(flags);\\nDescribe it:\",\"targets\":\"Android \\\"Roboto Light\\\" pixelation\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nbuilder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);\\nbuilder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);\\nDescribe it:\",\"targets\":\"Send request over Mobile data when WIFI is ON.(Android L)\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nddbClient.setRegion(Region.getRegion(Regions.EU_WEST_1)); \\n\\/\\/ Add correct Region. In my case its EU_WEST_1\\nDescribe it:\",\"targets\":\"AWS DynamoDB Requested resource not found\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\npublic void onRestart() { \\n super.onRestart();\\n \\/\\/When BACK BUTTON is pressed, the activity on the stack is restarted\\n \\/\\/Do what you want on the refresh procedure here\\n}\\nDescribe it:\",\"targets\":\"Back button and refreshing previous activity\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid volley sending data twice\\n\\nImplementation:\",\"targets\":\"JsonObjectRequest jsonObjReq = new JsonObjectRequest();\\njsonObjReq.setRetryPolicy(new DefaultRetryPolicy(\\n 0,\\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntv.setLayoutParams(new ViewGroup.LayoutParams(\\n ViewGroup.LayoutParams.WRAP_CONTENT,\\n ViewGroup.LayoutParams.WRAP_CONTENT));\\nDescribe it:\",\"targets\":\"android - setting LayoutParams programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: Insert text into EditText at current position\\n\\nImplementation:\",\"targets\":\"int start = Math.max(myEditText.getSelectionStart(), 0);\\nint end = Math.max(myEditText.getSelectionEnd(), 0);\\nmyEditText.getText().replace(Math.min(start, end), Math.max(start, end),\\n textToInsert, 0, textToInsert.length());\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nUnable to create call adapter for io.reactivex.Observable\\n\\nImplementation:\",\"targets\":\"Retrofit retrofit = new Retrofit.Builder()\\n .baseUrl(SERVICE_ENDPOINT)\\n .addCallAdapterFactory(RxJava2CallAdapterFactory.create())\\n .build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Link to Market from inside another app\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_VIEW);\\nintent.setData(Uri.parse(\\\"market:\\/\\/details?id=com.android.example\\\"));\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ Hide status bar\\ngetWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\\n\\/\\/ Show status bar\\ngetWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\\nDescribe it:\",\"targets\":\"Android: show\\/hide status bar\\/power bar\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic class myWebViewClient extends WebViewClient {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n view.loadUrl(url);\\n return true;\\n }\\n}\\nDescribe it:\",\"targets\":\"android webview stay in app\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid M Light and Dark status bar programmatically - how to make it dark again?\\n\\nImplementation:\",\"targets\":\"public static void clearLightStatusBar(@NonNull View view) {\\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\\n int flags = view.getSystemUiVisibility();\\n flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;\\n view.setSystemUiVisibility(flags);\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmspUserState.setOnTouchListener(new OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n if (event.getAction() == MotionEvent.ACTION_UP) {\\n doWhatIsRequired();\\n }\\n return false;\\n }\\n});\\nDescribe it:\",\"targets\":\"Setting a spinner onClickListener() in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nPrevent ViewPager from destroying off-screen views\\n\\nImplementation:\",\"targets\":\"mViewPager = (ViewPager)findViewById(R.id.pager);\\nmViewPager.setOffscreenPageLimit(2);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nalertDialog.getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);\\nDescribe it:\",\"targets\":\"How to resize AlertDialog on the Keyboard display\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get a list of installed android applications and pick one to run\\n\\nImplementation:\",\"targets\":\"Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);\\nmainIntent.addCategory(Intent.CATEGORY_LAUNCHER);\\nList pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nWifi Connect-Disconnect Listener\\n\\nImplementation:\",\"targets\":\"public class WifiReceiver extends BroadcastReceiver {\\n\\n @Override\\n public void onReceive(Context context, Intent intent) { \\n ConnectivityManager conMan = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); \\n NetworkInfo netInfo = conMan.getActiveNetworkInfo();\\n if (netInfo != null && netInfo.getType() == ConnectivityManager.TYPE_WIFI) \\n Log.d(\\\"WifiReceiver\\\", \\\"Have Wifi Connection\\\");\\n else\\n Log.d(\\\"WifiReceiver\\\", \\\"Don't have Wifi Connection\\\"); \\n } \\n};\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nBlurry.with(context)\\n .radius(10)\\n .sampling(8)\\n .color(Color.argb(66, 255, 255, 0))\\n .async()\\n .onto(rootView);\\nDescribe it:\",\"targets\":\"How to blur background images in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmWebView.setOnTouchListener(new View.OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n return true;\\n }\\n});\\nDescribe it:\",\"targets\":\"Disable WebView touch events in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent closeIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);\\ncontext.sendBroadcast(closeIntent);\\nDescribe it:\",\"targets\":\"How can I programmatically open\\/close notifications in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid dismiss keyboard\\n\\nImplementation:\",\"targets\":\"InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\\nimm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRadioGroup radioGroup = (RadioGroup)findViewById(R.id.radiogroup);\\nradioGroup.clearCheck();\\nDescribe it:\",\"targets\":\"Uncheck all RadioButton in a RadioButtonGroup\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, \\n getResources().getDimension(R.dimen.result_font));\\nDescribe it:\",\"targets\":\"Setting textSize programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid - Share on Facebook, Twitter, Mail, ecc\\n\\nImplementation:\",\"targets\":\"String message = \\\"Text I want to share.\\\";\\nIntent share = new Intent(Intent.ACTION_SEND);\\nshare.setType(\\\"text\\/plain\\\");\\nshare.putExtra(Intent.EXTRA_TEXT, message);\\n\\nstartActivity(Intent.createChooser(share, \\\"Title of the dialog the system will open\\\"));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nandroid.util.Patterns.EMAIL_ADDRESS.matcher(input).matches();\\nandroid.util.Patterns.PHONE.matcher(input).matches();\\nDescribe it:\",\"targets\":\"Email and phone Number Validation in android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get screen resolution of an android device using LIBGDX?\\n\\nImplementation:\",\"targets\":\"Gdx.graphics.getWidth();\\nGdx.graphics.getHeight();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nIs there any way to receive a notification when the user powers off the device?\\n\\nImplementation:\",\"targets\":\"public class ShutdownReceiver extends BroadcastReceiver {\\n\\n @Override\\n public void onReceive(Context context, Intent intent) {\\n \\/\\/Insert code here\\n }\\n\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to call getWindow() outside an Activity in Android?\\n\\nImplementation:\",\"targets\":\"void someMethodThatUsesActivity(Activity myActivityReference) {\\n myActivityReference.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nGoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\\n .requestIdToken(getString(R.string.default_web_client_id))\\n .requestEmail()\\n .build();\\nDescribe it:\",\"targets\":\"Google Sign-In requestIdToken returns null\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRetrofit retrofit = new Retrofit.Builder()\\n .baseUrl(endpoint)\\n .addConverterFactory(GsonConverterFactory.create())\\n .addCallAdapterFactory(RxJavaCallAdapterFactory.create())\\n .build();\\nDescribe it:\",\"targets\":\"IllegalArgumentException: Could not locate call adapter for rx.Observable RxJava, Retrofit2\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nyourEditText.setOnFocusChangeListener(new OnFocusChangeListener() {\\n@Override\\npublic void onFocusChange(View v, boolean hasFocus) {\\n if (hasFocus) {\\n \\/\\/got focus\\n } else {\\n \\/\\/lost focus\\n }\\n }\\n});\\nDescribe it:\",\"targets\":\"SoftKeyboard open and close listener in an activity in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nactionBar.setDisplayShowTitleEnabled(false);\\nactionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);\\nDescribe it:\",\"targets\":\"Make Tabs on ActionBar scroll when reach limit, rather than create a dropdown-list\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\\\"tel:\\\" + \\\"Your Phone_number\\\"));\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"How to make a phone call using intent in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic void minimizeApp() {\\n Intent startMain = new Intent(Intent.ACTION_MAIN);\\n startMain.addCategory(Intent.CATEGORY_HOME);\\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\n startActivity(startMain);\\n}\\nDescribe it:\",\"targets\":\"I need to minimize the android application on back button click\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nWhen I run Thread second time: java.lang.IllegalThreadStateException: Thread already started\\n\\nImplementation:\",\"targets\":\"if (thread.getState() == Thread.State.NEW)\\n{\\n thread.start();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nStrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();\\n StrictMode.setThreadPolicy(policy);\\nDescribe it:\",\"targets\":\"Quick fix for NetworkOnMainThreadException\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nscrollViewEventDetails.fullScroll(View.FOCUS_UP);\\/\\/if you move at the end of the scroll\\n\\nscrollViewEventDetails.pageScroll(View.FOCUS_UP);\\/\\/if you move at the middle of the scroll\\nDescribe it:\",\"targets\":\"Android: How to scroll ScrollView in top\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nIllegalArgumentException: Could not locate call adapter for rx.Observable RxJava, Retrofit2\\n\\nImplementation:\",\"targets\":\"Retrofit retrofit = new Retrofit.Builder()\\n .baseUrl(endpoint)\\n .addConverterFactory(GsonConverterFactory.create())\\n .addCallAdapterFactory(RxJavaCallAdapterFactory.create())\\n .build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSending an Intent to browser to open specific URL\\n\\nImplementation:\",\"targets\":\"String url = \\\"http:\\/\\/www.example.com\\\";\\nIntent i = new Intent(Intent.ACTION_VIEW);\\ni.setData(Uri.parse(url));\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nstartForeground(0, notification); \\/\\/ Doesn't work...\\n\\nstartForeground(1, notification); \\/\\/ Works!!!\\nDescribe it:\",\"targets\":\"startForeground() does not show my Notification\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nprivate Activity getActivity() {\\n Context context = getContext();\\n while (context instanceof ContextWrapper) {\\n if (context instanceof Activity) {\\n return (Activity)context;\\n }\\n context = ((ContextWrapper)context).getBaseContext();\\n }\\n return null;\\n}\\nDescribe it:\",\"targets\":\"Android get hosting Activity from a view\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRetrofit retrofit = new Retrofit.Builder()\\n .baseUrl(Constants.API_BASE_URL)\\n .addConverterFactory(GsonConverterFactory.create())\\n .build();\\nDescribe it:\",\"targets\":\"(Retrofit) Could not locate converter for class crashing app\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Spinner using ArrayList\\n\\nImplementation:\",\"targets\":\"ArrayAdapter karant_adapter = new ArrayAdapter(this,\\n android.R.layout.simple_spinner_item, return_likes);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nwebview showing white bar on right side\\n\\nImplementation:\",\"targets\":\"\\/\\/webview being your WebView object reference.\\nwebview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCanvas: trying to use a recycled bitmap android.graphics.Bitmap in android\\n\\nImplementation:\",\"targets\":\"if (mBitmap != null && !mBitmap.isRecycled()) {\\n mBitmap.recycle();\\n mBitmap = null; \\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_VIEW); \\nintent.setData(Uri.parse(\\\"market:\\/\\/search?q=pname:MyApp\\\")); \\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Start Android Market from App\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can I start the Accessibility Settings Page of my APP in Android?\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent i = new\\nIntent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"How to turn on the GPS on Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntry {\\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"twitter:\\/\\/user?screen_name=\\\" + twitter_user_name)));\\n}catch (Exception e) {\\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"https:\\/\\/twitter.com\\/#!\\/\\\" + twitter_user_name)));\\n}\\nDescribe it:\",\"targets\":\"Open Twitter application user profile from Android application\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to set multiple parent activities for using android back button\\n\\nImplementation:\",\"targets\":\"switch (item.getItemId()) {\\n case android.R.id.home:\\n finish();\\n return true;\\n default: \\n return super.onOptionsItemSelected(item);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\n public void onDestroyView() {\\n if (getDialog() != null && getRetainInstance()) {\\n getDialog().setDismissMessage(null);\\n }\\n super.onDestroyView();\\n }\\nDescribe it:\",\"targets\":\"Android DialogFragment disappears after orientation change\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_INSERT, \\n ContactsContract.Contacts.CONTENT_URI);\\n startActivity(intent);\\nDescribe it:\",\"targets\":\"How can I launch the 'Add Contact' activity in android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nUnable to create converter for my class in Android Retrofit library\\n\\nImplementation:\",\"targets\":\"Retrofit retrofit = new Retrofit.Builder()\\n .baseUrl(\\\"**sample base url here**\\\")\\n .addConverterFactory(GsonConverterFactory.create())\\n .build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid, how to choose save file location?\\n\\nImplementation:\",\"targets\":\"String extStorage = Environment.getExternalStorageState();\\npath = extStorage+\\\"\\/Android\\/data\\/com.mydomain.myapp\\/\\\";\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDestroy Pages on ViewPager and FragmentStatePagerAdapter\\n\\nImplementation:\",\"targets\":\"@Override\\npublic int getItemPosition(Object object) {\\n return POSITION_NONE;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDenied starting an intent without a user gesture Webview Android\\n\\nImplementation:\",\"targets\":\"webView.setWebViewClient(new WebViewClient() {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n return false; \\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: Special url to open Marketplace to a specific app?\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_VIEW);\\nintent.setData(Uri.parse(\\\"market:\\/\\/details?id=com.example.android\\\"));\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/Disable Map Toolbar:\\nmMap.getUiSettings().setMapToolbarEnabled(false);\\nDescribe it:\",\"targets\":\"How to hide \\\"Navigation\\\" and \\\"GPS Pointer\\\" buttons when I click the marker on the android google map\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid - setting LayoutParams programmatically\\n\\nImplementation:\",\"targets\":\"tv.setLayoutParams(new ViewGroup.LayoutParams(\\n ViewGroup.LayoutParams.WRAP_CONTENT,\\n ViewGroup.LayoutParams.WRAP_CONTENT));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\ncreating a menu after a long click event on a list view\\n\\nImplementation:\",\"targets\":\"view.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {\\n @Override\\n public void onCreateContextMenu(final ContextMenu menu, final View v,\\n final ContextMenuInfo menuInfo) {\\n\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nKeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\\nif( myKM.inKeyguardRestrictedInputMode()) {\\n \\/\\/it is locked\\n} else {\\n \\/\\/it is not locked\\n}\\nDescribe it:\",\"targets\":\"How to reveal that screen is locked?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Enable GPS programatically Android (without navigating to the location settings)\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n_webView.setWebViewClient(new WebViewClient() {\\n public void onPageFinished(WebView view, String url) {\\n _webView.loadUrl(\\n \\\"javascript:document.body.style.setProperty(\\\\\\\"color\\\\\\\", \\\\\\\"white\\\\\\\");\\\"\\n );\\n }\\n});\\nDescribe it:\",\"targets\":\"Changing text color in a WebView?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCheck if color is dark or light in Android\\n\\nImplementation:\",\"targets\":\"public boolean isColorDark(int color){\\n double darkness = 1-(0.299*Color.red(color) + 0.587*Color.green(color) + 0.114*Color.blue(color))\\/255;\\n if(darkness<0.5){\\n return false; \\/\\/ It's a light color\\n }else{\\n return true; \\/\\/ It's a dark color\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMove cursor to end of EditText?\\n\\nImplementation:\",\"targets\":\"String newtext = editText.getText().toString() + \\\"the new text\\\";\\neditText.setText(\\\"\\\");\\neditText.append(newtext);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRetrofit retrofit = new Retrofit.Builder()\\n .baseUrl(SERVICE_ENDPOINT)\\n .addCallAdapterFactory(RxJava2CallAdapterFactory.create())\\n .build();\\nDescribe it:\",\"targets\":\"Unable to create call adapter for io.reactivex.Observable\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nThe onClick() of ClickableSpan is not working for URLSpan?\\n\\nImplementation:\",\"targets\":\"\\/\\/ The original URLSpan needs to be removed to block the behavior of browser opening\\n strBuilder.removeSpan(span);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: show\\/hide status bar\\/power bar\\n\\nImplementation:\",\"targets\":\"\\/\\/ Hide status bar\\ngetWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\\n\\/\\/ Show status bar\\ngetWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nint xPos = (canvas.getWidth() \\/ 2);\\n int yPos = (int) ((canvas.getHeight() \\/ 2) - ((textPaint.descent() + textPaint.ascent()) \\/ 2)) ; \\n \\/\\/((textPaint.descent() + textPaint.ascent()) \\/ 2) is the distance from the baseline to the center.\\n\\n canvas.drawText(\\\"Hello\\\", xPos, yPos, textPaint);\\nDescribe it:\",\"targets\":\"Android Center text on canvas\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Toast Message is not showing\\n\\nImplementation:\",\"targets\":\"Toast.makeText(getBaseContext(), \\\"Amount can not be grater than invoice\\\",\\n Toast.LENGTH_SHORT).show();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nGoogle Sign-In requestIdToken returns null\\n\\nImplementation:\",\"targets\":\"GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\\n .requestIdToken(getString(R.string.default_web_client_id))\\n .requestEmail()\\n .build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCheck whether headphones are plugged in\\n\\nImplementation:\",\"targets\":\"AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);\\naudioManager.isWiredHeadsetOn();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmap.setOnMarkerClickListener(new OnMarkerClickListener() {\\n @Override\\n public boolean onMarkerClick(Marker marker) {\\n return true;\\n }\\n });\\nDescribe it:\",\"targets\":\"How to disable marker click event?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid - prevent TalkBack from announcing TextView title aloud\\n\\nImplementation:\",\"targets\":\"ViewCompat.setImportantForAccessibility(\\n decorativeTextView,\\n ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_MAIN);\\n intent.addCategory(Intent.CATEGORY_HOME);\\n startActivity(intent);\\nDescribe it:\",\"targets\":\"How to return to home screen from Activity\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCheck if RecyclerView is scrollable\\n\\nImplementation:\",\"targets\":\"public boolean isRecyclerScrollable(RecyclerView recyclerView) {\\n return recyclerView.computeHorizontalScrollRange() > recyclerView.getWidth() || recyclerView.computeVerticalScrollRange() > recyclerView.getHeight();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nClicking URLs opens default browser\\n\\nImplementation:\",\"targets\":\"private class HelloWebViewClient extends WebViewClient {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n view.loadUrl(url);\\n return true;\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nrequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); \\nsetProgressBarIndeterminateVisibility(true); \\nDescribe it:\",\"targets\":\"Using ProgressDialog in ActionBar (Android)\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can I programmatically open\\/close notifications in Android?\\n\\nImplementation:\",\"targets\":\"Intent closeIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);\\ncontext.sendBroadcast(closeIntent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMake Tabs on ActionBar scroll when reach limit, rather than create a dropdown-list\\n\\nImplementation:\",\"targets\":\"actionBar.setDisplayShowTitleEnabled(false);\\nactionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString enabledListeners = Settings.Secure.getString(context.getContentResolver(), \\n \\\"enabled_notification_listeners\\\");\\nDescribe it:\",\"targets\":\"Is there a way an app can check if it is allowed to access notifications?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to remove auto focus\\/keyboard popup of a field when the screen shows up?\\n\\nImplementation:\",\"targets\":\"InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\\nimm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can I check if GPS is enabled before I try to use it\\n\\nImplementation:\",\"targets\":\"if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){\\n \\/\\/Do what you need if enabled...\\n }else{\\n \\/\\/Do what you need if not enabled...\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nEnable GPS programatically Android (without navigating to the location settings)\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetActivity().finish();\\nSystem.exit(0);\\nDescribe it:\",\"targets\":\"Close android application programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nseekBar.setOnTouchListener(new OnTouchListener(){\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n return true;\\n }\\n });\\nDescribe it:\",\"targets\":\"android disable seek bar for audio controller\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nwebView.loadUrl(\\\"javascript:(function(){\\\"+\\n \\\"l=document.getElementById('mA');\\\"+\\n \\\"e=document.createEvent('HTMLEvents');\\\"+\\n \\\"e.initEvent('click',true,true);\\\"+\\n \\\"l.dispatchEvent(e);\\\"+\\n \\\"})()\\\");\\nDescribe it:\",\"targets\":\"programmatic click in Android WebView\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"How can I start the Accessibility Settings Page of my APP in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent startMain = new Intent(Intent.ACTION_MAIN);\\nstartMain.addCategory(Intent.CATEGORY_HOME);\\nstartMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(startMain);\\nDescribe it:\",\"targets\":\"Going to home screen programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString myVersion = android.os.Build.VERSION.RELEASE; \\/\\/ e.g. myVersion := \\\"1.6\\\"\\nint sdkVersion = android.os.Build.VERSION.SDK_INT; \\/\\/ e.g. sdkVersion := 8;\\nDescribe it:\",\"targets\":\"Getting device os version in Android programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to clear focus and remove keyboard on Android?\\n\\nImplementation:\",\"targets\":\"InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\\nimm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic static boolean isRoboUnitTest() {\\n return \\\"robolectric\\\".equals(Build.FINGERPRINT);\\n}\\nDescribe it:\",\"targets\":\"How do I know if my app is running with Robolectric?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: making a fullscreen application\\n\\nImplementation:\",\"targets\":\"getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmyWebView.post(new Runnable() {\\n @Override\\n public void run() {\\n webviewLoadURL(\\\"file:\\/\\/\\/android_asset\\/test1.html\\\");\\n }\\n});\\nDescribe it:\",\"targets\":\"android webview.loadUrl won't load another webpage\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nFile externalStorageDir = Environment.getExternalStorageDirectory();\\nStatFs statFs = new StatFs(externalStorageDir.getAbsolutePath()); \\nlong blocks = statFs.getAvailableBlocks();\\nlong free = (blocks * statFs.getBlockSize()) \\/ 1024 \\/ 1024;\\nDescribe it:\",\"targets\":\"How to check availability of space on external storage?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nint start = Math.max(myEditText.getSelectionStart(), 0);\\nint end = Math.max(myEditText.getSelectionEnd(), 0);\\nmyEditText.getText().replace(Math.min(start, end), Math.max(start, end),\\n textToInsert, 0, textToInsert.length());\\nDescribe it:\",\"targets\":\"Android: Insert text into EditText at current position\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nhow to create random UUID in Android when button click event happens?\\n\\nImplementation:\",\"targets\":\"if(uniqueId == null) { \\nuniqueId = UUID.randomUUID().toString(); \\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(context, YourSecondActivity.class);\\ncontext.startActivity(intent);\\n((Activity) context).finish();\\nDescribe it:\",\"targets\":\"Finish activity in dialog class\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to handle touch event on google map (MapFragment)?\\n\\nImplementation:\",\"targets\":\"map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\\n @Override\\n public void onMapClick(LatLng latLng) {\\n\\n \\/\\/Do what you want on obtained latLng\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to play ringtone\\/alarm sound in Android\\n\\nImplementation:\",\"targets\":\"Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\\nRingtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);\\nr.play();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString asciiName = Normalizer.normalize(unicodeName, Normalizer.Form.NFD)\\n .replaceAll(\\\"[^\\\\\\\\p{ASCII}]\\\", \\\"\\\");\\nDescribe it:\",\"targets\":\"How to ignore accent in SQLite query (Android)\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get elements(findViewById) for a layout which is dynamically loaded(setView) in a dialog?\\n\\nImplementation:\",\"targets\":\"View view = (View) LayoutInflater.from(ctx).inflate(R.layout.preference_report_bug_layout, null);\\nEditText editText = view.findViewById(R.id.bug_description_edittext);\\nbuilder.setView(view);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nLink should be open in same web view in Android\\n\\nImplementation:\",\"targets\":\"myWebView.setWebViewClient(new WebViewClient() {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {\\n view.loadUrl(request.getUrl().toString());\\n return false;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDisable soft-keyboard from EditText but still allow copy\\/paste?\\n\\nImplementation:\",\"targets\":\"getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,\\n WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nItemAnimator animator = recyclerView.getItemAnimator();\\nif (animator instanceof SimpleItemAnimator) {\\n ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);\\n}\\nDescribe it:\",\"targets\":\"RecyclerView blinking after notifyDatasetChanged()\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSend email via gmail\\n\\nImplementation:\",\"targets\":\"Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(\\n \\\"mailto\\\",\\\"abc@gmail.com\\\", null));\\nemailIntent.putExtra(Intent.EXTRA_SUBJECT, \\\"EXTRA_SUBJECT\\\");\\nstartActivity(Intent.createChooser(emailIntent, \\\"Send email...\\\"));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDisable animation of drawer icon in double navigation drawer for right drawer\\n\\nImplementation:\",\"targets\":\"@Override\\n public void onDrawerSlide(View drawerView, float slideOffset) \\n {\\n if(drawerView!=null && drawerView == rightDrawerListView){\\n super.onDrawerSlide(drawerView, 0);\\n }else{\\n super.onDrawerSlide(drawerView, slideOffset);\\n }\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nview.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {\\n @Override\\n public void onCreateContextMenu(final ContextMenu menu, final View v,\\n final ContextMenuInfo menuInfo) {\\n\\n }\\n});\\nDescribe it:\",\"targets\":\"creating a menu after a long click event on a list view\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid get hosting Activity from a view\\n\\nImplementation:\",\"targets\":\"private Activity getActivity() {\\n Context context = getContext();\\n while (context instanceof ContextWrapper) {\\n if (context instanceof Activity) {\\n return (Activity)context;\\n }\\n context = ((ContextWrapper)context).getBaseContext();\\n }\\n return null;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nprogrammatic click in Android WebView\\n\\nImplementation:\",\"targets\":\"webView.loadUrl(\\\"javascript:(function(){\\\"+\\n \\\"l=document.getElementById('mA');\\\"+\\n \\\"e=document.createEvent('HTMLEvents');\\\"+\\n \\\"e.initEvent('click',true,true);\\\"+\\n \\\"l.dispatchEvent(e);\\\"+\\n \\\"})()\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can i check whether an android device is connected to the web?\\n\\nImplementation:\",\"targets\":\"NetworkInfo ni = cm.getActiveNetworkInfo();\\nif (ni == null) {\\n \\/\\/ There are no active networks.\\n return false;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString serviceComponent = Settings.Secure.getString(mContext.getContentResolver(),\\n \\\"voice_recognition_service\\\");\\nDescribe it:\",\"targets\":\"How to query for the default SpeechRecognizer\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nOpening Android Settings programmatically\\n\\nImplementation:\",\"targets\":\"startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nwebView.setWebViewClient(new WebViewClient() {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n return false; \\n }\\n});\\nDescribe it:\",\"targets\":\"Denied starting an intent without a user gesture Webview Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (SensorManager.getRotationMatrix(m_rotationMatrix, null, m_lastAccels, m_lastMagFields)) {\\n}\\nDescribe it:\",\"targets\":\"How can I use SensorManager.getOrientation for tilt controls like \\\"My Paper Plane\\\"?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: setResult not working\\n\\nImplementation:\",\"targets\":\"getActivity().setResult(Activity.RESULT_OK, intent);\\ngetActivity().finish();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nGoogleMap map;\\nmap.getUiSettings().setMapToolbarEnabled(false);\\nDescribe it:\",\"targets\":\"Android google maps marker disable navigation option\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\\n task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\\n} else {\\n task.execute();\\n}\\nDescribe it:\",\"targets\":\"Second AsyncTask not executing\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(popup!=null){\\n \\/\\/dismiss the popup\\n popup.dismiss();\\n \\/\\/make popup null again\\n popup=null;\\n}\\nDescribe it:\",\"targets\":\"dismiss the popup window by back button\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\\n @Override\\n public void onMapClick(LatLng latLng) {\\n\\n \\/\\/Do what you want on obtained latLng\\n }\\n});\\nDescribe it:\",\"targets\":\"How to handle touch event on google map (MapFragment)?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCall fragment events from activity\\n\\nImplementation:\",\"targets\":\"FragmentB fragmentB = (FragmentB)getFragmentManager().findFragmentById(R.id.fragmentBId);\\nfragmentB.performSomeTask();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (getCallingActivity() == null) {\\n \\/\\/This Activity was called by startActivity \\n} else {\\n \\/\\/This Activity was called by startActivityForResult\\n}\\nDescribe it:\",\"targets\":\"How to know if an activity is called using startActivityForResult or simply called by using startActivity?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nActionbar Sherlock: Setting and hiding title bar\\n\\nImplementation:\",\"targets\":\"setTitle(\\\"Title\\\");\\ngetSupportActionBar().hide();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nQuick fix for NetworkOnMainThreadException\\n\\nImplementation:\",\"targets\":\"StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();\\n StrictMode.setThreadPolicy(policy);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nSettings.Secure.putString(getContentResolver(), \\n Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, \\\"pkgname\\/classname\\\");\\nSettings.Secure.putString(getContentResolver(), \\n Settings.Secure.ACCESSIBILITY_ENABLED, \\\"1\\\");\\nDescribe it:\",\"targets\":\"How to Programmatically Enable\\/Disable Accessibility Service in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic int getStatusBarHeight() {\\n int result = 0;\\n int resourceId = getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resourceId > 0) {\\n result = getResources().getDimensionPixelSize(resourceId);\\n }\\n return result;\\n}\\nDescribe it:\",\"targets\":\"Height of status bar in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid backup\\/restore: how to backup an internal database?\\n\\nImplementation:\",\"targets\":\"FileBackupHelper hosts = new FileBackupHelper(this,\\n \\\"..\\/databases\\/\\\" + HostDatabase.DB_NAME);\\naddHelper(HostDatabase.DB_NAME, hosts);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic boolean isLoggedIn() {\\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\\n return accessToken != null;\\n}\\nDescribe it:\",\"targets\":\"How to check if user is logged in with FB SDK 4.0 for Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nArrayAdapter adapter = new ArrayAdapter(this,\\n android.R.layout.simple_list_item_1, android.R.id.text1, values);\\nDescribe it:\",\"targets\":\"ArrayAdapter in android to create simple listview\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nChanging text color in a WebView?\\n\\nImplementation:\",\"targets\":\"_webView.setWebViewClient(new WebViewClient() {\\n public void onPageFinished(WebView view, String url) {\\n _webView.loadUrl(\\n \\\"javascript:document.body.style.setProperty(\\\\\\\"color\\\\\\\", \\\\\\\"white\\\\\\\");\\\"\\n );\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nrequestWindowFeature(Window.FEATURE_NO_TITLE);\\/\\/ hide statusbar of Android\\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\\nDescribe it:\",\"targets\":\"Hide status bar android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCannot use getSystemService(\\\"usagestats\\\") Android Studio\\n\\nImplementation:\",\"targets\":\"\\/\\/noinspection ResourceType\\nUsageStatsManager usageStatsManager=(UsageStatsManager)context.getSystemService(\\\"usagestats\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nboolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();\\nboolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);\\n\\nif(!hasMenuKey && !hasBackKey) {\\n \\/\\/ Do whatever you need to do, this device has a navigation bar\\n}\\nDescribe it:\",\"targets\":\"Check for navigation bar\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nFinish activity in dialog class\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(context, YourSecondActivity.class);\\ncontext.startActivity(intent);\\n((Activity) context).finish();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nrecorder = new MediaRecorder(); \\nrecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);\\nDescribe it:\",\"targets\":\"Video recording format(.3gp or mp4) in android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to hide the soft keyboard from inside a fragment?\\n\\nImplementation:\",\"targets\":\"getActivity().getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nI need to minimize the android application on back button click\\n\\nImplementation:\",\"targets\":\"public void minimizeApp() {\\n Intent startMain = new Intent(Intent.ACTION_MAIN);\\n startMain.addCategory(Intent.CATEGORY_HOME);\\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\n startActivity(startMain);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nStart Android Market from App\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_VIEW); \\nintent.setData(Uri.parse(\\\"market:\\/\\/search?q=pname:MyApp\\\")); \\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to open number dialer pad programmatically in android?\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_DIAL); \\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAWS DynamoDB Requested resource not found\\n\\nImplementation:\",\"targets\":\"ddbClient.setRegion(Region.getRegion(Regions.EU_WEST_1)); \\n\\/\\/ Add correct Region. In my case its EU_WEST_1\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHeight of screen without status bar, actionBar and tabs\\n\\nImplementation:\",\"targets\":\"int resource = context.getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resource > 0) {\\n statusBarHeight = context.getResources().getDimensionPixelSize(resource);\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic MenuItem setActionView(int resId) {\\n final Context context = mMenu.getContext();\\n final LayoutInflater inflater = LayoutInflater.from(context);\\n setActionView(inflater.inflate(resId, new LinearLayout(context), false));\\n return this;\\n}\\nDescribe it:\",\"targets\":\"What should I pass for root when inflating a layout to use for a MenuItem's ActionView?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nscroll.post(new Runnable() { \\n @Override\\n public void run() {\\n scroll.fullScroll(View.FOCUS_DOWN); \\n }\\n});\\nDescribe it:\",\"targets\":\"Android: ScrollView force to bottom\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow do I check HoneyComb or higher is running, and accordingly call a method for that Version?\\n\\nImplementation:\",\"targets\":\"if (android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.HONEYCOMB) {\\n \\/\\/ call something for API Level 11+\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to open phones gallery through code\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent();\\nintent.setType(\\\"image\\/*\\\");\\nintent.setAction(Intent.ACTION_GET_CONTENT);\\nstartActivityForResult(Intent.createChooser(intent, \\\"Select Picture\\\"),SELECT_IMAGE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSetting a spinner onClickListener() in Android\\n\\nImplementation:\",\"targets\":\"mspUserState.setOnTouchListener(new OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n if (event.getAction() == MotionEvent.ACTION_UP) {\\n doWhatIsRequired();\\n }\\n return false;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to prevent OnItemClickListener work when long click performed?\\n\\nImplementation:\",\"targets\":\"public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { \\n return true;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSetting textSize programmatically\\n\\nImplementation:\",\"targets\":\"textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, \\n getResources().getDimension(R.dimen.result_font));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to determine device screen size category (small, normal, large, xlarge) using code?\\n\\nImplementation:\",\"targets\":\"if ((getResources().getConfiguration().screenLayout & \\n Configuration.SCREENLAYOUT_SIZE_MASK) == \\n Configuration.SCREENLAYOUT_SIZE_LARGE) {\\n \\/\\/ on a large screen device ...\\n\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nBitmapFactory.decodeFile out of memory with images 2400x2400\\n\\nImplementation:\",\"targets\":\"BitmapFactory.Options options = new BitmapFactory.Options();\\n options.inJustDecodeBounds = false;\\n options.inPreferredConfig = Config.RGB_565;\\n options.inDither = true;\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\\nDescribe it:\",\"targets\":\"Android: making a fullscreen application\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nFragmentB fragmentB = (FragmentB)getFragmentManager().findFragmentById(R.id.fragmentBId);\\nfragmentB.performSomeTask();\\nDescribe it:\",\"targets\":\"Call fragment events from activity\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent sendIntent = new Intent();\\nsendIntent.setAction(Intent.ACTION_SEND);\\nsendIntent.putExtra(Intent.EXTRA_TEXT,\\n \\\"Hey check out my app at: https:\\/\\/play.google.com\\/store\\/apps\\/details?id=com.google.android.apps.plus\\\");\\nsendIntent.setType(\\\"text\\/plain\\\");\\nstartActivity(sendIntent);\\nDescribe it:\",\"targets\":\"How to Share Entire Android App with Share Intent\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to prevent Screen Capture in Android\\n\\nImplementation:\",\"targets\":\"getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,\\n WindowManager.LayoutParams.FLAG_SECURE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to check availability of space on external storage?\\n\\nImplementation:\",\"targets\":\"File externalStorageDir = Environment.getExternalStorageDirectory();\\nStatFs statFs = new StatFs(externalStorageDir.getAbsolutePath()); \\nlong blocks = statFs.getAvailableBlocks();\\nlong free = (blocks * statFs.getBlockSize()) \\/ 1024 \\/ 1024;\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nLinking back to amazon app store for ratings\\n\\nImplementation:\",\"targets\":\"Intent goToAppstore = new Intent(Intent.ACTION_VIEW,Uri.parse(\\\"http:\\/\\/www.amazon.com\\/gp\\/mas\\/dl\\/andro\\\" +\\\"id?p=com.yapp.blah\\\"));\\ngoToAppstore.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\ncontext.startActivity(goToAppstore);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nanim.setAnimationListener(new Animation.AnimationListener(){\\n @Override\\n public void onAnimationStart(Animation arg0) {\\n } \\n @Override\\n public void onAnimationRepeat(Animation arg0) {\\n } \\n @Override\\n public void onAnimationEnd(Animation arg0) {\\n }\\n});\\nDescribe it:\",\"targets\":\"End animation event android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCancelling a PendingIntent\\n\\nImplementation:\",\"targets\":\"PendingIntent.getBroadcast(context, 0, intent, \\n PendingIntent.FLAG_UPDATE_CURRENT).cancel();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ndensity = getResources().getDisplayMetrics().density;\\n\\n\\/\\/ return 0.75 if it's LDPI\\n\\/\\/ return 1.0 if it's MDPI\\n\\/\\/ return 1.5 if it's HDPI\\n\\/\\/ return 2.0 if it's XHDPI\\n\\/\\/ return 3.0 if it's XXHDPI\\n\\/\\/ return 4.0 if it's XXXHDPI\\nDescribe it:\",\"targets\":\"How to check an Android device is HDPI screen or MDPI screen?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid disable seek bar for audio controller\\n\\nImplementation:\",\"targets\":\"seekBar.setOnTouchListener(new OnTouchListener(){\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n return true;\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to disable and enable the scrolling on android ScrollView?\\n\\nImplementation:\",\"targets\":\"mScrollView.setOnTouchListener( new OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) \\n {\\n return true;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nfinal TypedArray styledAttributes = getContext().getTheme().obtainStyledAttributes(\\n new int[] { android.R.attr.actionBarSize });\\nmActionBarSize = (int) styledAttributes.getDimension(0, 0);\\nstyledAttributes.recycle();\\nDescribe it:\",\"targets\":\"What is the size of ActionBar in pixels?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nRetrieving Android API version programmatically\\n\\nImplementation:\",\"targets\":\"if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){\\n \\/\\/ Do something for lollipop and above versions\\n} else{\\n \\/\\/ do something for phones running an SDK before lollipop\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to check an Android device is HDPI screen or MDPI screen?\\n\\nImplementation:\",\"targets\":\"density = getResources().getDisplayMetrics().density;\\n\\n\\/\\/ return 0.75 if it's LDPI\\n\\/\\/ return 1.0 if it's MDPI\\n\\/\\/ return 1.5 if it's HDPI\\n\\/\\/ return 2.0 if it's XHDPI\\n\\/\\/ return 3.0 if it's XXHDPI\\n\\/\\/ return 4.0 if it's XXXHDPI\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intentOpenBluetoothSettings = new Intent();\\nintentOpenBluetoothSettings.setAction(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS); \\nstartActivity(intentOpenBluetoothSettings);\\nDescribe it:\",\"targets\":\"How do I open the Bluetooth Settings Activity programmatically?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to Programmatically Enable\\/Disable Accessibility Service in Android\\n\\nImplementation:\",\"targets\":\"Settings.Secure.putString(getContentResolver(), \\n Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, \\\"pkgname\\/classname\\\");\\nSettings.Secure.putString(getContentResolver(), \\n Settings.Secure.ACCESSIBILITY_ENABLED, \\\"1\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nNo animation on item removal on RecyclerView\\n\\nImplementation:\",\"targets\":\"myDataset.remove(position); \\/\\/ myDataset is List\\nmAdapter.notifyItemRemoved(position);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_DIAL); \\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"How to open number dialer pad programmatically in android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to show marker in Maps launched by geo uri Intent?\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"geo:,?q=,(Label+Name)\\\"));\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSend request over Mobile data when WIFI is ON.(Android L)\\n\\nImplementation:\",\"targets\":\"builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);\\nbuilder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmWebView.getSettings().setAppCacheEnabled(false);\\n mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);\\nDescribe it:\",\"targets\":\"How to disable cache in android webview?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nIdentifying RTL language in Android\\n\\nImplementation:\",\"targets\":\"Configuration config = getResources().getConfiguration();\\nif(config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {\\n \\/\\/in Right To Left layout\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: Cloning a drawable in order to make a StateListDrawable with filters\\n\\nImplementation:\",\"targets\":\"Drawable clone = drawable.getConstantState().newDrawable();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nbutton.setOnTouchListener(new OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/ TODO Auto-generated method stub\\n return false;\\n }\\n });\\nDescribe it:\",\"targets\":\"Triggering event when Button is pressed down in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\n public void onDrawerSlide(View drawerView, float slideOffset) \\n {\\n if(drawerView!=null && drawerView == rightDrawerListView){\\n super.onDrawerSlide(drawerView, 0);\\n }else{\\n super.onDrawerSlide(drawerView, slideOffset);\\n }\\n }\\nDescribe it:\",\"targets\":\"Disable animation of drawer icon in double navigation drawer for right drawer\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nGet URI from drawable image\\n\\nImplementation:\",\"targets\":\"Resources resources = context.getResources();\\nUri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + \\\":\\/\\/\\\" + resources.getResourcePackageName(resId) + '\\/' + resources.getResourceTypeName(resId) + '\\/' + resources.getResourceEntryName(resId) );\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic int getStatusBarHeight() {\\n int result = 0;\\n int resourceId = getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resourceId > 0) {\\n result = getResources().getDimensionPixelSize(resourceId);\\n }\\n return result;\\n}\\nDescribe it:\",\"targets\":\"Height of statusbar?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmyWebView.setWebViewClient(new WebViewClient() {\\n public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {\\n myWebView.loadUrl(\\\"file:\\/\\/\\/android_asset\\/custom_url_error.htm\\\");\\n\\n }\\n});\\nDescribe it:\",\"targets\":\"How to edit or create custom error page for WebView?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid version check\\n\\nImplementation:\",\"targets\":\"\\/\\/ Check if we're running on Android 5.0 or higher\\nif (Build.VERSION.SDK_INT >= 21) {\\n \\/\\/ Call some material design APIs here\\n} else {\\n \\/\\/ Implement this feature without material design\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent gpsOptionsIntent = new Intent( \\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); \\nstartActivity(gpsOptionsIntent);\\nDescribe it:\",\"targets\":\"How to prompt user to enable GPS_PROVIDER and\\/or NETWORK_PROVIDER?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = getIntent();\\nfinish();\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"How do I restart an Android Activity\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to hide current location in google map?\\n\\nImplementation:\",\"targets\":\"map.setMyLocationEnabled(false);\\nmap.getUiSettings().setMyLocationButtonEnabled(false);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nIntercept and override HTTP requests from WebView\\n\\nImplementation:\",\"targets\":\"webView.setWebViewClient(new WebViewClient() {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n if (url.startsWith(\\\"foo:\\/\\/\\\")) {\\n \\/\\/ magic\\n return true;\\n }\\n return false;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nAudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);\\naudioManager.isWiredHeadsetOn();\\nDescribe it:\",\"targets\":\"Check whether headphones are plugged in\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid - Set text to TextView\\n\\nImplementation:\",\"targets\":\"\\/\\/ globally \\nTextView myAwesomeTextView = (TextView)findViewById(R.id.myAwesomeTextView);\\n\\n\\/\\/in your OnCreate() method\\nmyAwesomeTextView.setText(\\\"My Awesome Text\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\nprotected void onSizeChanged(int xNew, int yNew, int xOld, int yOld){\\n super.onSizeChanged(xNew, yNew, xOld, yOld);\\n\\n viewWidth = xNew;\\n viewHeight = yNew;\\n}\\nDescribe it:\",\"targets\":\"Android: How to get a custom View's height and width?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to delete a whole folder and content?\\n\\nImplementation:\",\"targets\":\"void deleteRecursive(File fileOrDirectory) {\\n if (fileOrDirectory.isDirectory())\\n for (File child : fileOrDirectory.listFiles())\\n deleteRecursive(child);\\n\\n fileOrDirectory.delete();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nwebView.setWebViewClient(new WebViewClient() {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n if (url.startsWith(\\\"foo:\\/\\/\\\")) {\\n \\/\\/ magic\\n return true;\\n }\\n return false;\\n }\\n});\\nDescribe it:\",\"targets\":\"Intercept and override HTTP requests from WebView\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRoom.databaseBuilder(context.getApplicationContext(), \\n AppDatabase.class, \\n \\\"database_name.db\\\")\\n.openHelperFactory(new AssetSQLiteOpenHelperFactory())\\n.allowMainThreadQueries()\\n.build();\\nDescribe it:\",\"targets\":\"How to use Room Persistence Library with pre-populated database?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDisable Action Bar button in Android\\n\\nImplementation:\",\"targets\":\"if (disableButtonFlag) {\\n menu.findItem(R.id.your_item).setEnabled(false);\\n} else {\\n menu.findItem(R.id.your_item).setEnabled(true);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nRecyclerView blinking after notifyDatasetChanged()\\n\\nImplementation:\",\"targets\":\"ItemAnimator animator = recyclerView.getItemAnimator();\\nif (animator instanceof SimpleItemAnimator) {\\n ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to turn on the GPS on Android\\n\\nImplementation:\",\"targets\":\"Intent i = new\\nIntent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get a reference to LocationManager inside a Fragment\\n\\nImplementation:\",\"targets\":\"LocationManager mgr = \\n(LocationManager)getActivity().getSystemService(Context.LOCATION_SERVICE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmView.setOnTouchListener(new OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/show dialog here\\n return false;\\n }\\n});\\nDescribe it:\",\"targets\":\"How do I detect touch input on the Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to return to home screen from Activity\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_MAIN);\\n intent.addCategory(Intent.CATEGORY_HOME);\\n startActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmap.setMyLocationEnabled(true);\\nmap.getUiSettings().setMyLocationButtonEnabled(false);\\nDescribe it:\",\"targets\":\"Disable center button in MyLocation at Google Map API V2\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nyourTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\\nyourTextView.setText(\\\"The Text You Need In There\\\");\\nDescribe it:\",\"targets\":\"How to remove drawableleft\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\n(Retrofit) Could not locate converter for class crashing app\\n\\nImplementation:\",\"targets\":\"Retrofit retrofit = new Retrofit.Builder()\\n .baseUrl(Constants.API_BASE_URL)\\n .addConverterFactory(GsonConverterFactory.create())\\n .build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCrashlytics deprecated method disabled()\\n\\nImplementation:\",\"targets\":\"CrashlyticsCore core = new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build();\\nFabric.with(this, new Crashlytics.Builder().core(core).build());\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmSwipeRefreshLayout.post(new Runnable() {\\n @Override\\n public void run() {\\n mSwipeRefreshLayout.setRefreshing(true);\\n }\\n });\\nDescribe it:\",\"targets\":\"SwipeRefreshLayout trigger programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nmake a phone call click on a button\\n\\nImplementation:\",\"targets\":\"Intent callIntent = new Intent(Intent.ACTION_CALL);\\n callIntent.setData(Uri.parse(\\\"tel:123456789\\\"));\\n startActivity(callIntent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nFile f = context.getDatabasePath(dbName);\\nlong dbSize = f.length();\\nDescribe it:\",\"targets\":\"How to get the current sqlite database size or package size in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDisable ScrollView Programmatically?\\n\\nImplementation:\",\"targets\":\"scrollView.setOnTouchListener(new View.OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/ TODO Auto-generated method stub\\n return isBlockedScrollView;\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n int today = calendar.get(Calendar.DAY_OF_WEEK);\\n boolean isWeekend = (today == Calendar.SUNDAY) || (today == Calendar.SATURDAY);\\n if(isWeekend && noWeekends == true) {\\n \\/\\/Alarm is not wanted on the weekend\\n try {\\n Thread.sleep(1); \\n } catch (InterruptedException e) {\\n e.printStackTrace();\\n }\\n }\\nDescribe it:\",\"targets\":\"Prevent repeating alarm from occurring on weekend\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to access drawable resources (color) in java\\n\\nImplementation:\",\"targets\":\"myButton.setBackgroundColor(Color.parseColor(\\\"#RRGGBB\\\"));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to ignore accent in SQLite query (Android)\\n\\nImplementation:\",\"targets\":\"String asciiName = Normalizer.normalize(unicodeName, Normalizer.Form.NFD)\\n .replaceAll(\\\"[^\\\\\\\\p{ASCII}]\\\", \\\"\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\npublic int getItemPosition(Object object) {\\n return POSITION_NONE;\\n}\\nDescribe it:\",\"targets\":\"Destroy Pages on ViewPager and FragmentStatePagerAdapter\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to blur background images in Android\\n\\nImplementation:\",\"targets\":\"Blurry.with(context)\\n .radius(10)\\n .sampling(8)\\n .color(Color.argb(66, 255, 255, 0))\\n .async()\\n .onto(rootView);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString s = \\\"Line 1\\\"\\n + System.getProperty (\\\"line.separator\\\")\\n + \\\"Line 2\\\"\\n + System.getProperty (\\\"line.separator\\\");\\nDescribe it:\",\"targets\":\"How to add a line break in an Android TextView?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nInputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\\nimm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);\\nDescribe it:\",\"targets\":\"How to clear focus and remove keyboard on Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (disableButtonFlag) {\\n menu.findItem(R.id.your_item).setEnabled(false);\\n} else {\\n menu.findItem(R.id.your_item).setEnabled(true);\\n}\\nDescribe it:\",\"targets\":\"Disable Action Bar button in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nbrowserInt.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|\\n Intent.FLAG_ACTIVITY_SINGLE_TOP);\\nDescribe it:\",\"targets\":\"onNewIntent is not called\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to call a .NET Webservice from Android using KSOAP2?\\n\\nImplementation:\",\"targets\":\"SoapPrimitive result = (SoapPrimitive)envelope.getResponse();\\nString strRes = result.toString();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nLocationManager mgr = \\n(LocationManager)getActivity().getSystemService(Context.LOCATION_SERVICE);\\nDescribe it:\",\"targets\":\"How to get a reference to LocationManager inside a Fragment\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (locationManager != null) {\\n if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED\\n || checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\\n locationManager.removeUpdates(GPSListener.this);\\n }\\n}\\nDescribe it:\",\"targets\":\"Location Manager remove updates permission\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent goToNextActivity = new Intent(getApplicationContext(), YourNewClass.class);\\nstartActivity(goToNextActivity);\\nDescribe it:\",\"targets\":\"Moving from One activity to next in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Center text on canvas\\n\\nImplementation:\",\"targets\":\"int xPos = (canvas.getWidth() \\/ 2);\\n int yPos = (int) ((canvas.getHeight() \\/ 2) - ((textPaint.descent() + textPaint.ascent()) \\/ 2)) ; \\n \\/\\/((textPaint.descent() + textPaint.ascent()) \\/ 2) is the distance from the baseline to the center.\\n\\n canvas.drawText(\\\"Hello\\\", xPos, yPos, textPaint);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,\\n WindowManager.LayoutParams.FLAG_SECURE);\\nDescribe it:\",\"targets\":\"How to prevent Screen Capture in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDisable center button in MyLocation at Google Map API V2\\n\\nImplementation:\",\"targets\":\"map.setMyLocationEnabled(true);\\nmap.getUiSettings().setMyLocationButtonEnabled(false);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent callIntent = new Intent(Intent.ACTION_CALL);\\ncallIntent.setData(Uri.parse(\\\"tel:123456789\\\"));\\nstartActivity(callIntent);\\nDescribe it:\",\"targets\":\"android: How to call the number by android application\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nClose\\/hide the Android Soft Keyboard\\n\\nImplementation:\",\"targets\":\"\\/\\/ Check if no view has focus:\\nView view = this.getCurrentFocus();\\nif (view != null) { InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0);}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nWhen do we use the recyclerView.setHasFixedSize?\\n\\nImplementation:\",\"targets\":\"RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);\\nrecyclerView.setHasFixedSize(true);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get accent color programmatically?\\n\\nImplementation:\",\"targets\":\"private int fetchAccentColor() {\\n TypedValue typedValue = new TypedValue();\\n\\n TypedArray a = mContext.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent });\\n int color = a.getColor(0, 0);\\n\\n a.recycle();\\n\\n return color;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nsetCustomAnimations(R.anim.enter_from_left, R.anim.enter_from_left,\\n R.anim.exit_to_left, R.anim.exit_to_left);\\nDescribe it:\",\"targets\":\"Android pop fragment from backstack with animation\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid webview.loadUrl won't load another webpage\\n\\nImplementation:\",\"targets\":\"myWebView.post(new Runnable() {\\n @Override\\n public void run() {\\n webviewLoadURL(\\\"file:\\/\\/\\/android_asset\\/test1.html\\\");\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nWhat should I pass for root when inflating a layout to use for a MenuItem's ActionView?\\n\\nImplementation:\",\"targets\":\"public MenuItem setActionView(int resId) {\\n final Context context = mMenu.getContext();\\n final LayoutInflater inflater = LayoutInflater.from(context);\\n setActionView(inflater.inflate(resId, new LinearLayout(context), false));\\n return this;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic void onDestroy() {\\n super.onDestroy();\\n android.os.Process.killProcess(android.os.Process.myPid());\\n }\\nDescribe it:\",\"targets\":\"How to kill my own Activity - the hard way\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nwebSettings.setAllowFileAccessFromFileURLs(true);\\nwebSettings.setAllowUniversalAccessFromFileURLs(true);\\nDescribe it:\",\"targets\":\"Framework7 inside webview pages not loading\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ Calculate ActionBar height\\nTypedValue tv = new TypedValue();\\nif (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))\\n{\\n actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());\\n}\\nDescribe it:\",\"targets\":\"How to get the ActionBar height?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntextcontent.setText(Html.fromHtml(item.get_text()));\\ntextcontent.setAutoLinkMask(Linkify.WEB_URLS);\\nDescribe it:\",\"targets\":\"Android: How can I add HTML links inside a ListView?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nintentForMcuService.setComponent(new ComponentName(\\\"com.admetric.modemwatcher\\\",\\n \\\"com.admetric.modemwatcher.ModemWatcherService\\\"));\\nDescribe it:\",\"targets\":\"Binding to a service from another app\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nLayoutInflater inflater = (LayoutInflater)getApplicationContext().getSystemService\\n (Context.LAYOUT_INFLATER_SERVICE);\\nView view = inflater.inflate(R.layout.new_layout,null);\\nmain.addView(view);\\nDescribe it:\",\"targets\":\"How to Inflate view from XML in Android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nSystem.setProperty(\\n \\\"dexmaker.dexcache\\\",\\n getInstrumentation().getTargetContext().getCacheDir().getPath());\\nDescribe it:\",\"targets\":\"Mockito + Dexmaker on Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nPendingIntent.getBroadcast(context, 0, intent, \\n PendingIntent.FLAG_UPDATE_CURRENT).cancel();\\nDescribe it:\",\"targets\":\"Cancelling a PendingIntent\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nTriggering event when Button is pressed down in Android\\n\\nImplementation:\",\"targets\":\"button.setOnTouchListener(new OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/ TODO Auto-generated method stub\\n return false;\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\\nDescribe it:\",\"targets\":\"OnScreen keyboard opens automatically when Activity starts\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif ((getResources().getConfiguration().screenLayout & \\n Configuration.SCREENLAYOUT_SIZE_MASK) == \\n Configuration.SCREENLAYOUT_SIZE_LARGE) {\\n \\/\\/ on a large screen device ...\\n\\n}\\nDescribe it:\",\"targets\":\"How to determine device screen size category (small, normal, large, xlarge) using code?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nrequestWindowFeature(Window.FEATURE_NO_TITLE);\\ngetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\\nDescribe it:\",\"targets\":\"How to disable status bar \\/ notification bar on android programmatically?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nstatePagerAdapter = new FragmentStatePagerAdapter(fragmentManager) {\\n @Override\\n public CharSequence getPageTitle(int position) {\\n return \\\"Title Here\\\";\\n }\\n};\\nDescribe it:\",\"targets\":\"Adding titles to ViewPager\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmyVideoView.setOnPreparedListener(new OnPreparedListener() {\\n\\n @Override\\n public void onPrepared(MediaPlayer mp) {\\n \\/\\/ TODO Auto-generated method stub\\n mp.setLooping(true);\\n\\n }\\n });\\nDescribe it:\",\"targets\":\"Android VideoView repetition\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString newUA= \\\"Mozilla\\/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko\\/20100101 Firefox\\/4.0\\\";\\n mWebView.getSettings().setUserAgentString(newUA);\\nDescribe it:\",\"targets\":\"Setting WebView to view Desktop Site and Not Mobile Site\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow do I prevent Android taking a screenshot when my app goes to the background?\\n\\nImplementation:\",\"targets\":\"if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nArrayAdapter karant_adapter = new ArrayAdapter(this,\\n android.R.layout.simple_spinner_item, return_likes);\\nDescribe it:\",\"targets\":\"Android Spinner using ArrayList\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to disable cache in android webview?\\n\\nImplementation:\",\"targets\":\"mWebView.getSettings().setAppCacheEnabled(false);\\n mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHeight of statusbar?\\n\\nImplementation:\",\"targets\":\"public int getStatusBarHeight() {\\n int result = 0;\\n int resourceId = getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resourceId > 0) {\\n result = getResources().getDimensionPixelSize(resourceId);\\n }\\n return result;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid 4.4 translucent Status and Navigation bars style on Android 5.0\\n\\nImplementation:\",\"targets\":\"getWindow().getDecorView().setSystemUiVisibility(\\n View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMPAndroidChart: bottom x-axis and multiple y-axes\\n\\nImplementation:\",\"targets\":\"XAxis xAxis = chart.getXAxis();\\nxAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to push recylerView up when keyboard appear?\\n\\nImplementation:\",\"targets\":\"mRecyclerView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {\\n @Override\\n\\npublic void onLayoutChange(View v, int left, int top, int right,int bottom, int oldLeft, int oldTop,int oldRight, int oldBottom)\\n{\\n\\nmRecyclerView.scrollToPosition(mMessages.size()-1);\\n\\n}\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nEmail and phone Number Validation in android\\n\\nImplementation:\",\"targets\":\"android.util.Patterns.EMAIL_ADDRESS.matcher(input).matches();\\nandroid.util.Patterns.PHONE.matcher(input).matches();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nInputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\\nimm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);\\nDescribe it:\",\"targets\":\"Android dismiss keyboard\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetActivity().setResult(Activity.RESULT_OK, intent);\\ngetActivity().finish();\\nDescribe it:\",\"targets\":\"Android: setResult not working\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ The original URLSpan needs to be removed to block the behavior of browser opening\\n strBuilder.removeSpan(span);\\nDescribe it:\",\"targets\":\"The onClick() of ClickableSpan is not working for URLSpan?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDisable WebView touch events in Android\\n\\nImplementation:\",\"targets\":\"mWebView.setOnTouchListener(new View.OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n return true;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to edit or create custom error page for WebView?\\n\\nImplementation:\",\"targets\":\"myWebView.setWebViewClient(new WebViewClient() {\\n public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {\\n myWebView.loadUrl(\\\"file:\\/\\/\\/android_asset\\/custom_url_error.htm\\\");\\n\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_VIEW);\\nintent.setData(Uri.parse(\\\"market:\\/\\/details?id=com.example.android\\\"));\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Android: Special url to open Marketplace to a specific app?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to Share Entire Android App with Share Intent\\n\\nImplementation:\",\"targets\":\"Intent sendIntent = new Intent();\\nsendIntent.setAction(Intent.ACTION_SEND);\\nsendIntent.putExtra(Intent.EXTRA_TEXT,\\n \\\"Hey check out my app at: https:\\/\\/play.google.com\\/store\\/apps\\/details?id=com.google.android.apps.plus\\\");\\nsendIntent.setType(\\\"text\\/plain\\\");\\nstartActivity(sendIntent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSoft keyboard enter key event handle\\n\\nImplementation:\",\"targets\":\"if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN) {\\n Log.d(TAG, \\\"enter_key_called\\\");\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent startMain = new Intent(Intent.ACTION_MAIN);\\nstartMain.addCategory(Intent.CATEGORY_HOME);\\nstartMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(startMain);\\nDescribe it:\",\"targets\":\"How to minimize whole application in android?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHeight of status bar in Android\\n\\nImplementation:\",\"targets\":\"public int getStatusBarHeight() {\\n int result = 0;\\n int resourceId = getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resourceId > 0) {\\n result = getResources().getDimensionPixelSize(resourceId);\\n }\\n return result;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nJsonObjectRequest jsonObjReq = new JsonObjectRequest();\\njsonObjReq.setRetryPolicy(new DefaultRetryPolicy(\\n 0,\\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\\nDescribe it:\",\"targets\":\"Android volley sending data twice\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nOpen Twitter application user profile from Android application\\n\\nImplementation:\",\"targets\":\"try {\\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"twitter:\\/\\/user?screen_name=\\\" + twitter_user_name)));\\n}catch (Exception e) {\\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\\\"https:\\/\\/twitter.com\\/#!\\/\\\" + twitter_user_name)));\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic boolean isRecyclerScrollable(RecyclerView recyclerView) {\\n return recyclerView.computeHorizontalScrollRange() > recyclerView.getWidth() || recyclerView.computeVerticalScrollRange() > recyclerView.getHeight();\\n}\\nDescribe it:\",\"targets\":\"Check if RecyclerView is scrollable\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nNetworkInfo ni = cm.getActiveNetworkInfo();\\nif (ni == null) {\\n \\/\\/ There are no active networks.\\n return false;\\n}\\nDescribe it:\",\"targets\":\"How can i check whether an android device is connected to the web?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nPrevent repeating alarm from occurring on weekend\\n\\nImplementation:\",\"targets\":\"int today = calendar.get(Calendar.DAY_OF_WEEK);\\n boolean isWeekend = (today == Calendar.SUNDAY) || (today == Calendar.SATURDAY);\\n if(isWeekend && noWeekends == true) {\\n \\/\\/Alarm is not wanted on the weekend\\n try {\\n Thread.sleep(1); \\n } catch (InterruptedException e) {\\n e.printStackTrace();\\n }\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {\\n \\/\\/ signed in. Show the \\\"sign out\\\" button and explanation.\\n \\/\\/ ...\\n} else {\\n \\/\\/ not signed in. Show the \\\"sign in\\\" button and explanation.\\n \\/\\/ ...\\n}\\nDescribe it:\",\"targets\":\"Android Google Sign In: check if User is signed in\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nonNewIntent is not called\\n\\nImplementation:\",\"targets\":\"browserInt.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|\\n Intent.FLAG_ACTIVITY_SINGLE_TOP);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = getIntent();\\nfinish();\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Programmatically relaunch\\/recreate an activity?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nFileBackupHelper hosts = new FileBackupHelper(this,\\n \\\"..\\/databases\\/\\\" + HostDatabase.DB_NAME);\\naddHelper(HostDatabase.DB_NAME, hosts);\\nDescribe it:\",\"targets\":\"Android backup\\/restore: how to backup an internal database?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to prevent the screen of an android device to turn off during the execution of an Activity?\\n\\nImplementation:\",\"targets\":\"if (keepScreenOn)\\n getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\\nelse\\n getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nGoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\\n .requestIdToken(getString(R.string.default_web_client_id))\\n .requestEmail()\\n .build();\\nDescribe it:\",\"targets\":\"Token null Sign-in Google Account\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/webview being your WebView object reference.\\nwebview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);\\nDescribe it:\",\"targets\":\"webview showing white bar on right side\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Reading from an Input stream efficiently\\n\\nImplementation:\",\"targets\":\"BufferedReader r = new BufferedReader(new InputStreamReader(inputStream));\\nStringBuilder total = new StringBuilder();\\nString line;\\nwhile ((line = r.readLine()) != null) {\\n total.append(line).append('\\\\n');\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nBitmapFactory.Options options = new BitmapFactory.Options();\\n options.inJustDecodeBounds = false;\\n options.inPreferredConfig = Config.RGB_565;\\n options.inDither = true;\\nDescribe it:\",\"targets\":\"BitmapFactory.decodeFile out of memory with images 2400x2400\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(uniqueId == null) { \\nuniqueId = UUID.randomUUID().toString(); \\n}\\nDescribe it:\",\"targets\":\"how to create random UUID in Android when button click event happens?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to prompt user to enable GPS_PROVIDER and\\/or NETWORK_PROVIDER?\\n\\nImplementation:\",\"targets\":\"Intent gpsOptionsIntent = new Intent( \\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); \\nstartActivity(gpsOptionsIntent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nResume the Activity instead of Starting if already exists in back stack\\n\\nImplementation:\",\"targets\":\"intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmScrollView.setOnTouchListener( new OnTouchListener() {\\n\\n @Override\\n public boolean onTouch(View v, MotionEvent event) \\n {\\n return true;\\n }\\n});\\nDescribe it:\",\"targets\":\"How to disable and enable the scrolling on android ScrollView?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent mainIntent = new Intent(Intent.ACTION_MAIN, null);\\nmainIntent.addCategory(Intent.CATEGORY_LAUNCHER);\\nList pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);\\nDescribe it:\",\"targets\":\"How to get a list of installed android applications and pick one to run\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent i = getBaseContext().getPackageManager()\\n .getLaunchIntentForPackage( getBaseContext().getPackageName() );\\ni.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"Force application to restart on first activity\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can I launch the 'Add Contact' activity in android\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_INSERT, \\n ContactsContract.Contacts.CONTENT_URI);\\n startActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(\\n \\\"mailto\\\",\\\"abc@gmail.com\\\", null));\\nemailIntent.putExtra(Intent.EXTRA_SUBJECT, \\\"EXTRA_SUBJECT\\\");\\nstartActivity(Intent.createChooser(emailIntent, \\\"Send email...\\\"));\\nDescribe it:\",\"targets\":\"Send email via gmail\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(mPlayer.isPlaying()){\\n mPlayer.pause();\\n} else {\\n mPlayer.start();\\n}\\nDescribe it:\",\"targets\":\"Android Media Player play\\/pause Button\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get the ActionBar height?\\n\\nImplementation:\",\"targets\":\"\\/\\/ Calculate ActionBar height\\nTypedValue tv = new TypedValue();\\nif (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))\\n{\\n actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nprivate class HelloWebViewClient extends WebViewClient {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n view.loadUrl(url);\\n return true;\\n }\\n}\\nDescribe it:\",\"targets\":\"Clicking URLs opens default browser\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic static ViewAction swipeUp() { \\nreturn new GeneralSwipeAction(Swipe.FAST, GeneralLocation.BOTTOM_CENTER, \\n GeneralLocation.TOP_CENTER, Press.FINGER); \\n}\\nDescribe it:\",\"targets\":\"Drag & Drop Espresso\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to make a callback after the view is completely rendered?\\n\\nImplementation:\",\"targets\":\"@Override\\npublic void onWindowFocusChanged(boolean hasFocus) {\\n super.onWindowFocusChanged(hasFocus);\\n doWhateverAfterScreenViewIsRendered();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to hide \\\"Navigation\\\" and \\\"GPS Pointer\\\" buttons when I click the marker on the android google map\\n\\nImplementation:\",\"targets\":\"\\/\\/Disable Map Toolbar:\\nmMap.getUiSettings().setMapToolbarEnabled(false);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to exit from the application and show the home screen?\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_MAIN);\\nintent.addCategory(Intent.CATEGORY_HOME);\\nintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: How can I add HTML links inside a ListView?\\n\\nImplementation:\",\"targets\":\"textcontent.setText(Html.fromHtml(item.get_text()));\\ntextcontent.setAutoLinkMask(Linkify.WEB_URLS);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to handle Back button with in the dialog?\\n\\nImplementation:\",\"targets\":\"dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { \\n @Override\\n public void onCancel(DialogInterface dialog) {\\n \\/\\/do whatever you want the back key to do\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMockito + Dexmaker on Android\\n\\nImplementation:\",\"targets\":\"System.setProperty(\\n \\\"dexmaker.dexcache\\\",\\n getInstrumentation().getTargetContext().getCacheDir().getPath());\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nIs there a way an app can check if it is allowed to access notifications?\\n\\nImplementation:\",\"targets\":\"String enabledListeners = Settings.Secure.getString(context.getContentResolver(), \\n \\\"enabled_notification_listeners\\\");\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nNavigation drawer - Disable click through on items behind the drawer\\n\\nImplementation:\",\"targets\":\"mFragmentContainerView.setOnTouchListener(new View.OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n return true;\\n }\\n });\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nGetting device os version in Android programmatically\\n\\nImplementation:\",\"targets\":\"String myVersion = android.os.Build.VERSION.RELEASE; \\/\\/ e.g. myVersion := \\\"1.6\\\"\\nint sdkVersion = android.os.Build.VERSION.SDK_INT; \\/\\/ e.g. sdkVersion := 8;\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nDon't navigate to other pages in WebView,disable links and references\\n\\nImplementation:\",\"targets\":\"webView.setWebViewClient(new WebViewClient(){\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n return true;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){\\n \\/\\/Do what you need if enabled...\\n }else{\\n \\/\\/Do what you need if not enabled...\\n }\\nDescribe it:\",\"targets\":\"How can I check if GPS is enabled before I try to use it\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nLocation Manager remove updates permission\\n\\nImplementation:\",\"targets\":\"if (locationManager != null) {\\n if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED\\n || checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\\n locationManager.removeUpdates(GPSListener.this);\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to reveal that screen is locked?\\n\\nImplementation:\",\"targets\":\"KeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\\nif( myKM.inKeyguardRestrictedInputMode()) {\\n \\/\\/it is locked\\n} else {\\n \\/\\/it is not locked\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ni = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\\nstartActivityForResult(i, CHOOSE_IMAGE);\\nDescribe it:\",\"targets\":\"Android KitKat securityException when trying to read from MediaStore\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid - width and height of bitmap without loading it\\n\\nImplementation:\",\"targets\":\"BitmapFactory.Options options = new BitmapFactory.Options();\\noptions.inJustDecodeBounds = true;\\nBitmapFactory.decodeResource(getResources(), R.id.myimage, options);\\nint imageHeight = options.outHeight;\\nint imageWidth = options.outWidth;\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to handle an intent which does not have data at first call of an activity?\\n\\nImplementation:\",\"targets\":\"if( getIntent().getExtras() != null)\\n{\\n \\/\\/do here\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).\\n toggleSoftInput(InputMethodManager.SHOW_FORCED,\\n InputMethodManager.HIDE_IMPLICIT_ONLY);\\nDescribe it:\",\"targets\":\"Showing the soft keyboard for SearchView on ActionBar\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nWhat is the size of ActionBar in pixels?\\n\\nImplementation:\",\"targets\":\"final TypedArray styledAttributes = getContext().getTheme().obtainStyledAttributes(\\n new int[] { android.R.attr.actionBarSize });\\nmActionBarSize = (int) styledAttributes.getDimension(0, 0);\\nstyledAttributes.recycle();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent goToAppstore = new Intent(Intent.ACTION_VIEW,Uri.parse(\\\"http:\\/\\/www.amazon.com\\/gp\\/mas\\/dl\\/andro\\\" +\\\"id?p=com.yapp.blah\\\"));\\ngoToAppstore.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\ncontext.startActivity(goToAppstore);\\nDescribe it:\",\"targets\":\"Linking back to amazon app store for ratings\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to determine which platform the current app is running on in LibGDX?\\n\\nImplementation:\",\"targets\":\"if(Gdx.app.getType() == ApplicationType.iOS) {\\n \\/\\/Do awesome stuff for iOS here\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: checkbox listener\\n\\nImplementation:\",\"targets\":\"satView.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\\n\\n @Override\\n public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {\\n\\n }\\n }\\n);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmap.setMyLocationEnabled(false);\\nmap.getUiSettings().setMyLocationButtonEnabled(false);\\nDescribe it:\",\"targets\":\"How to hide current location in google map?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nGoing to home screen programmatically\\n\\nImplementation:\",\"targets\":\"Intent startMain = new Intent(Intent.ACTION_MAIN);\\nstartMain.addCategory(Intent.CATEGORY_HOME);\\nstartMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(startMain);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to disable status bar \\/ notification bar on android programmatically?\\n\\nImplementation:\",\"targets\":\"requestWindowFeature(Window.FEATURE_NO_TITLE);\\ngetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid DialogFragment disappears after orientation change\\n\\nImplementation:\",\"targets\":\"@Override\\n public void onDestroyView() {\\n if (getDialog() != null && getRetainInstance()) {\\n getDialog().setDismissMessage(null);\\n }\\n super.onDestroyView();\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nStart new navigation without exiting from previous navigation in Google Map\\n\\nImplementation:\",\"targets\":\"intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid \\\"Roboto Light\\\" pixelation\\n\\nImplementation:\",\"targets\":\"int flags = textView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG\\n | Paint.ANTI_ALIAS_FLAG;\\ntextView.setPaintFlags(flags);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get main Activity class or class name of my application?\\n\\nImplementation:\",\"targets\":\"String packageName = context.getPackageName();\\nIntent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);\\nString className = launchIntent.getComponent().getClassName();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n@Override\\npublic void onWindowFocusChanged(boolean hasFocus) {\\n super.onWindowFocusChanged(hasFocus);\\n doWhateverAfterScreenViewIsRendered();\\n}\\nDescribe it:\",\"targets\":\"How to make a callback after the view is completely rendered?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow To Show and hide ActionBar with AppCompat v.7\\n\\nImplementation:\",\"targets\":\"getSupportActionBar().hide(); \\/\\/ for hiding\\ngetSupportActionBar().show(); \\/\\/ for showing\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nBitmapFactory.Options options = new BitmapFactory.Options();\\noptions.inJustDecodeBounds = true;\\nBitmapFactory.decodeResource(getResources(), R.id.myimage, options);\\nint imageHeight = options.outHeight;\\nint imageWidth = options.outWidth;\\nDescribe it:\",\"targets\":\"Android - width and height of bitmap without loading it\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/to show soft keyboard\\nimm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);\\n\\n\\/\\/to hide it, call the method again\\nimm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);\\nDescribe it:\",\"targets\":\"How to close Android Soft KeyBoard programmatically?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMove snackbar above the bottom bar\\n\\nImplementation:\",\"targets\":\"Snackbar snack = Snackbar.make(findViewById(R.id.coordinatorLayout),\\n \\\"Your message\\\", Snackbar.LENGTH_LONG);\\nCoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams)\\nsnack.getView().getLayoutParams();\\nparams.setMargins(leftMargin, topMargin, rightMargin, bottomBar.height);\\nsnack.getView().setLayoutParams(params);\\nsnack.show();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nStart Google search query from activity - Android\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);\\nintent.putExtra(SearchManager.QUERY, query); \\/\\/ query contains search string\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nVideo recording format(.3gp or mp4) in android?\\n\\nImplementation:\",\"targets\":\"recorder = new MediaRecorder(); \\nrecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nstartActivity(intent);\\n\\noverridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);\\nDescribe it:\",\"targets\":\"How to start an Activity with an animation set entirely programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to minimize whole application in android?\\n\\nImplementation:\",\"targets\":\"Intent startMain = new Intent(Intent.ACTION_MAIN);\\nstartMain.addCategory(Intent.CATEGORY_HOME);\\nstartMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nstartActivity(startMain);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString newtext = editText.getText().toString() + \\\"the new text\\\";\\neditText.setText(\\\"\\\");\\neditText.append(newtext);\\nDescribe it:\",\"targets\":\"Move cursor to end of EditText?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to detect device is Android phone or Android tablet?\\n\\nImplementation:\",\"targets\":\"public static boolean isTablet(Context context) {\\n return (context.getResources().getConfiguration().screenLayout\\n & Configuration.SCREENLAYOUT_SIZE_MASK)\\n >= Configuration.SCREENLAYOUT_SIZE_LARGE;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nhow do I restart an activity in android?\\n\\nImplementation:\",\"targets\":\"Intent intent = getIntent();\\nfinish();\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to lock phone orientation in Android to prevent landscape mode\\n\\nImplementation:\",\"targets\":\"\\/\\/ This forces a vertical screen.\\nsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCustom android AccelerateDecelerateInterpolator\\n\\nImplementation:\",\"targets\":\"public class MVAccelerateDecelerateInterpolator implements Interpolator {\\n\\n \\/\\/ easeInOutQuint\\n public float getInterpolation(float t) {\\n float x = t*2.0f;\\n if (t<0.5f) return 0.5f*x*x*x*x*x;\\n x = (t-0.5f)*2-1;\\n return 0.5f*x*x*x*x*x+1;\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString packageName = context.getPackageName();\\nIntent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);\\nString className = launchIntent.getComponent().getClassName();\\nDescribe it:\",\"targets\":\"How to get main Activity class or class name of my application?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nIs it possible that when click edittext it will show dialog message?\\n\\nImplementation:\",\"targets\":\"mDateDisplay.setClickable(true);\\nmDateDisplay.setOnClickListener(new View.OnClickListener() {\\n @Override\\n public void onClick(View v) {\\n showDialog(DATE_DIALOG_ID);\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid How to use MediaScannerConnection scanFile\\n\\nImplementation:\",\"targets\":\"sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(\\\"file:\\/\\/\\\"\\n + Environment.getExternalStorageDirectory())));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ This forces a vertical screen.\\nsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\\nDescribe it:\",\"targets\":\"How to lock phone orientation in Android to prevent landscape mode\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmSwipeRefreshLayout.post(new Runnable() {\\n @Override\\n public void run() {\\n mSwipeRefreshLayout.setRefreshing(true);\\n }\\n});\\nDescribe it:\",\"targets\":\"SwipeRefreshLayout setRefreshing() not showing indicator initially\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can one detect airplane mode on Android?\\n\\nImplementation:\",\"targets\":\"\\/**\\n* Gets the state of Airplane Mode.\\n* \\n* @param context\\n* @return true if enabled.\\n*\\/\\nprivate static boolean isAirplaneModeOn(Context context) {\\n\\n return Settings.System.getInt(context.getContentResolver(),\\n Settings.System.AIRPLANE_MODE_ON, 0) != 0;\\n\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(Intent.ACTION_VIEW);\\nintent.setData(Uri.parse(\\\"market:\\/\\/details?id=com.android.example\\\"));\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Android Link to Market from inside another app\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString extStorage = Environment.getExternalStorageState();\\npath = extStorage+\\\"\\/Android\\/data\\/com.mydomain.myapp\\/\\\";\\nDescribe it:\",\"targets\":\"Android, how to choose save file location?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid open camera from button\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(\\\"android.media.action.IMAGE_CAPTURE\\\");\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid pop fragment from backstack with animation\\n\\nImplementation:\",\"targets\":\"setCustomAnimations(R.anim.enter_from_left, R.anim.enter_from_left,\\n R.anim.exit_to_left, R.anim.exit_to_left);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Media Player play\\/pause Button\\n\\nImplementation:\",\"targets\":\"if(mPlayer.isPlaying()){\\n mPlayer.pause();\\n} else {\\n mPlayer.start();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCheck for navigation bar\\n\\nImplementation:\",\"targets\":\"boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();\\nboolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);\\n\\nif(!hasMenuKey && !hasBackKey) {\\n \\/\\/ Do whatever you need to do, this device has a navigation bar\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif( getIntent().getExtras() != null)\\n{\\n \\/\\/do here\\n}\\nDescribe it:\",\"targets\":\"How to handle an intent which does not have data at first call of an activity?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow can I post on Twitter with Intent Action_send?\\n\\nImplementation:\",\"targets\":\"String url = \\\"http:\\/\\/www.twitter.com\\/intent\\/tweet?url=YOURURL&text=YOURTEXT\\\";\\nIntent i = new Intent(Intent.ACTION_VIEW);\\ni.setData(Uri.parse(url));\\nstartActivity(i);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nswitch (item.getItemId()) {\\n case android.R.id.home:\\n finish();\\n return true;\\n default: \\n return super.onOptionsItemSelected(item);\\n}\\nDescribe it:\",\"targets\":\"How to set multiple parent activities for using android back button\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nCall removeView() on the child's parent first\\n\\nImplementation:\",\"targets\":\"((ViewGroup)scrollChildLayout.getParent()).removeView(scrollChildLayout);\\n\\/\\/scrollView.removeView(scrollChildLayout);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmFragmentContainerView.setOnTouchListener(new View.OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n return true;\\n }\\n });\\nDescribe it:\",\"targets\":\"Navigation drawer - Disable click through on items behind the drawer\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nsatView.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\\n\\n @Override\\n public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {\\n\\n }\\n }\\n);\\nDescribe it:\",\"targets\":\"Android: checkbox listener\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nBinding to a service from another app\\n\\nImplementation:\",\"targets\":\"intentForMcuService.setComponent(new ComponentName(\\\"com.admetric.modemwatcher\\\",\\n \\\"com.admetric.modemwatcher.ModemWatcherService\\\"));\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent i = new Intent(this, Wakeup.class);\\ni.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\\nDescribe it:\",\"targets\":\"Calling startActivity() from outside of an Activity?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);\\n}\\nDescribe it:\",\"targets\":\"How do I prevent Android taking a screenshot when my app goes to the background?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetActivity().getWindow().setSoftInputMode(\\n WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);\\nDescribe it:\",\"targets\":\"How to hide the soft keyboard from inside a fragment?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nRecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);\\nrecyclerView.setHasFixedSize(true);\\nDescribe it:\",\"targets\":\"When do we use the recyclerView.setHasFixedSize?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nstartForeground() does not show my Notification\\n\\nImplementation:\",\"targets\":\"startForeground(0, notification); \\/\\/ Doesn't work...\\n\\nstartForeground(1, notification); \\/\\/ Works!!!\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nProgrammatically relaunch\\/recreate an activity?\\n\\nImplementation:\",\"targets\":\"Intent intent = getIntent();\\nfinish();\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to make a phone call using intent in Android?\\n\\nImplementation:\",\"targets\":\"Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\\\"tel:\\\" + \\\"Your Phone_number\\\"));\\nstartActivity(intent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent i = new Intent(Intent.ACTION_MAIN);\\ni.addCategory(Intent.CATEGORY_HOME);\\nstartActivity(i);\\nDescribe it:\",\"targets\":\"Android - Simulate Home click\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic static Bitmap RotateBitmap(Bitmap source, float angle)\\n{\\n Matrix matrix = new Matrix();\\n matrix.postRotate(angle);\\n return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);\\n}\\nDescribe it:\",\"targets\":\"Android: How to rotate a bitmap on a center point\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: How to get a custom View's height and width?\\n\\nImplementation:\",\"targets\":\"@Override\\nprotected void onSizeChanged(int xNew, int yNew, int xOld, int yOld){\\n super.onSizeChanged(xNew, yNew, xOld, yOld);\\n\\n viewWidth = xNew;\\n viewHeight = yNew;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN) {\\n Log.d(TAG, \\\"enter_key_called\\\");\\n}\\nDescribe it:\",\"targets\":\"Soft keyboard enter key event handle\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nTypedValue outValue = new TypedValue();\\ngetContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);\\ncardView.setBackgroundResource(outValue.resourceId);\\nDescribe it:\",\"targets\":\"Programatically set '?selectableItemBackground' on Android view\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nsetTitle(\\\"Title\\\");\\ngetSupportActionBar().hide();\\nDescribe it:\",\"targets\":\"Actionbar Sherlock: Setting and hiding title bar\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid activity over default lock screen\\n\\nImplementation:\",\"targets\":\"getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|\\n WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|\\n WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|\\n WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nNavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);\\n navigationView.setItemIconTintList(null);\\n navigationView.setNavigationItemSelectedListener(this);\\nDescribe it:\",\"targets\":\"Navigation drawer menu icon is not displayed correctly\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nEditText editText = (EditText)findViewById(R.id.yourId);\\nString editTextStr = editText.getText().toString();\\nDescribe it:\",\"targets\":\"How to Retrieve Text from Textbox in Android widget?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nGoogle Maps v2 - set both my location and zoom in\\n\\nImplementation:\",\"targets\":\"CameraUpdate center=\\n CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044,\\n -73.98180484771729));\\n CameraUpdate zoom=CameraUpdateFactory.zoomTo(15);\\n\\n map.moveCamera(center);\\n map.animateCamera(zoom);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nIntent intent = new Intent(\\\"android.media.action.IMAGE_CAPTURE\\\");\\nstartActivity(intent);\\nDescribe it:\",\"targets\":\"Android open camera from button\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmDateDisplay.setClickable(true);\\nmDateDisplay.setOnClickListener(new View.OnClickListener() {\\n @Override\\n public void onClick(View v) {\\n showDialog(DATE_DIALOG_ID);\\n }\\n});\\nDescribe it:\",\"targets\":\"Is it possible that when click edittext it will show dialog message?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\npublic static boolean isTablet(Context context) {\\n return (context.getResources().getConfiguration().screenLayout\\n & Configuration.SCREENLAYOUT_SIZE_MASK)\\n >= Configuration.SCREENLAYOUT_SIZE_LARGE;\\n}\\nDescribe it:\",\"targets\":\"How to detect device is Android phone or Android tablet?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nClick on notification starts activity twice\\n\\nImplementation:\",\"targets\":\"notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP\\n |Intent.FLAG_ACTIVITY_SINGLE_TOP);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nwv.setWebViewClient(new WebViewClient() {\\npublic boolean shouldOverrideUrlLoading(WebView view, String url) {\\n view.loadUrl(url);\\n return true;\\n }});\\nDescribe it:\",\"targets\":\"Opening webview not in new browser\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nint resource = context.getResources().getIdentifier(\\\"status_bar_height\\\", \\\"dimen\\\", \\\"android\\\");\\n if (resource > 0) {\\n statusBarHeight = context.getResources().getDimensionPixelSize(resource);\\n }\\nDescribe it:\",\"targets\":\"Height of screen without status bar, actionBar and tabs\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif(Gdx.app.getType() == ApplicationType.iOS) {\\n \\/\\/Do awesome stuff for iOS here\\n}\\nDescribe it:\",\"targets\":\"How to determine which platform the current app is running on in LibGDX?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to get the build\\/version number of your Android application?\\n\\nImplementation:\",\"targets\":\"try {\\n PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0);\\n String version = pInfo.versionName;\\n} catch (PackageManager.NameNotFoundException e) {\\n e.printStackTrace();\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid Status Bar Notifications - Intent getting the old extras on the second time\\n\\nImplementation:\",\"targets\":\"PendingIntent pintent = \\n PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ntry {\\n PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0);\\n String version = pInfo.versionName;\\n} catch (PackageManager.NameNotFoundException e) {\\n e.printStackTrace();\\n}\\nDescribe it:\",\"targets\":\"How to get the build\\/version number of your Android application?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow do I detect touch input on the Android\\n\\nImplementation:\",\"targets\":\"mView.setOnTouchListener(new OnTouchListener() {\\n @Override\\n public boolean onTouch(View v, MotionEvent event) {\\n \\/\\/show dialog here\\n return false;\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nmyDataset.remove(position); \\/\\/ myDataset is List\\nmAdapter.notifyItemRemoved(position);\\nDescribe it:\",\"targets\":\"No animation on item removal on RecyclerView\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nvideoView.setOnPreparedListener(new OnPreparedListener() {\\n @Override\\n public void onPrepared(MediaPlayer mp) {\\n mp.setLooping(true);\\n }\\n});\\nDescribe it:\",\"targets\":\"Seamless video Loop with VideoView\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to know if an activity is called using startActivityForResult or simply called by using startActivity?\\n\\nImplementation:\",\"targets\":\"if (getCallingActivity() == null) {\\n \\/\\/This Activity was called by startActivity \\n} else {\\n \\/\\/This Activity was called by startActivityForResult\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow do I know if my app is running with Robolectric?\\n\\nImplementation:\",\"targets\":\"public static boolean isRoboUnitTest() {\\n return \\\"robolectric\\\".equals(Build.FINGERPRINT);\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nSeamless video Loop with VideoView\\n\\nImplementation:\",\"targets\":\"videoView.setOnPreparedListener(new OnPreparedListener() {\\n @Override\\n public void onPrepared(MediaPlayer mp) {\\n mp.setLooping(true);\\n }\\n});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nString message = \\\"Text I want to share.\\\";\\nIntent share = new Intent(Intent.ACTION_SEND);\\nshare.setType(\\\"text\\/plain\\\");\\nshare.putExtra(Intent.EXTRA_TEXT, message);\\n\\nstartActivity(Intent.createChooser(share, \\\"Title of the dialog the system will open\\\"));\\nDescribe it:\",\"targets\":\"Android - Share on Facebook, Twitter, Mail, ecc\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\n\\/\\/ Check if we're running on Android 5.0 or higher\\nif (Build.VERSION.SDK_INT >= 21) {\\n \\/\\/ Call some material design APIs here\\n} else {\\n \\/\\/ Implement this feature without material design\\n}\\nDescribe it:\",\"targets\":\"Android version check\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nUri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\\nRingtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);\\nr.play();\\nDescribe it:\",\"targets\":\"How to play ringtone\\/alarm sound in Android\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().getDecorView().setSystemUiVisibility(\\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\\n| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\\n| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\\n| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\\n| View.SYSTEM_UI_FLAG_FULLSCREEN\\n| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\\nDescribe it:\",\"targets\":\"Using full screen Activity\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nDefaultItemAnimator animator = new DefaultItemAnimator() {\\n @Override\\n public boolean canReuseUpdatedViewHolder(RecyclerView.ViewHolder viewHolder) {\\n return true;\\n }\\n };\\nmRecyclerView.setItemAnimator(animator);\\nDescribe it:\",\"targets\":\"RecyclerView.Adapter.notifyItemChanged() never passes payload to onBindViewHolder()\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nRedirect user to the Subscription page in the playstore\\n\\nImplementation:\",\"targets\":\"Intent browserIntent = new Intent(Intent.ACTION_VIEW,\\n Uri.parse(\\\"https:\\/\\/play.google.com\\/store\\/account\\\"));\\n startActivity(browserIntent);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nToken null Sign-in Google Account\\n\\nImplementation:\",\"targets\":\"GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\\n .requestIdToken(getString(R.string.default_web_client_id))\\n .requestEmail()\\n .build();\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nMoving from One activity to next in Android\\n\\nImplementation:\",\"targets\":\"Intent goToNextActivity = new Intent(getApplicationContext(), YourNewClass.class);\\nstartActivity(goToNextActivity);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nstartActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);\\nDescribe it:\",\"targets\":\"Opening Android Settings programmatically\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nArrayAdapter in android to create simple listview\\n\\nImplementation:\",\"targets\":\"ArrayAdapter adapter = new ArrayAdapter(this,\\n android.R.layout.simple_list_item_1, android.R.id.text1, values);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nandroid webview stay in app\\n\\nImplementation:\",\"targets\":\"public class myWebViewClient extends WebViewClient {\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\\n view.loadUrl(url);\\n return true;\\n }\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\ngetWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,\\n WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);\\nDescribe it:\",\"targets\":\"Disable soft-keyboard from EditText but still allow copy\\/paste?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nvoid deleteRecursive(File fileOrDirectory) {\\n if (fileOrDirectory.isDirectory())\\n for (File child : fileOrDirectory.listFiles())\\n deleteRecursive(child);\\n\\n fileOrDirectory.delete();\\n}\\nDescribe it:\",\"targets\":\"How to delete a whole folder and content?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nOpening webview not in new browser\\n\\nImplementation:\",\"targets\":\"wv.setWebViewClient(new WebViewClient() {\\npublic boolean shouldOverrideUrlLoading(WebView view, String url) {\\n view.loadUrl(url);\\n return true;\\n }});\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nthis.mWebView.setWebViewClient(new WebViewClient(){\\n\\n @Override\\n public boolean shouldOverrideUrlLoading(WebView view, String url){\\n view.loadUrl(url);\\n return true;\\n }\\n});\\nDescribe it:\",\"targets\":\"Android WebView click open within WebView not a default browser\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nAndroid: allow portrait and landscape for tablets, but force portrait on phone?\\n\\nImplementation:\",\"targets\":\"if(getResources().getBoolean(R.bool.portrait_only)){\\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\\n }\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nRestore default actionbar layout\\n\\nImplementation:\",\"targets\":\"getActivity().getActionBar().setDisplayOptions(\\n ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Given the following code:\\nif (Build.VERSION.SDK_INT < 11) {\\n final AlphaAnimation animation = new AlphaAnimation(alpha, alpha);\\n animation.setDuration(duration);\\n animation.setFillAfter(true);\\n view.startAnimation(animation);\\n} else {\\n view.setAlpha(alpha);\\n}\\n\\nDescribe it:\",\"targets\":\"How to set View alpha in lower Api than 11?\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate a description given code\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n" "{\"inputs\":\"Description:\\nHow to check if user is logged in with FB SDK 4.0 for Android?\\n\\nImplementation:\",\"targets\":\"public boolean isLoggedIn() {\\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\\n return accessToken != null;\\n}\",\"language\":\"python\",\"split\":\"train\",\"template\":\"generate code given a description\",\"dataset\":\"neural_code_search\",\"config\":\"evaluation_dataset\"}\n"