[Solved] How to install the new Android Studio 2.0

I have downloaded the stable version of Android Studio 2.0, it’s just an archive with files. Just unpack the archive wherever you want or download stable version with installer as listed in the table on the bottom of official page: https://developer.android.com/sdk/index.html solved How to install the new Android Studio 2.0

[Solved] Why not do all the operations in the main thread(Android)? [closed]

From the docs: When an application is launched, the system creates a thread of execution for the application, called “main.” This thread is very important because it is in charge of dispatching events to the appropriate user interface widgets, including drawing events. In other words, ALL UI-related tasks occur on the same thread, and it … Read more

[Solved] Android Spinner showing transparent screen with distortion of data,but items are selectable

Add this dependencies in build.gradle file compile ‘com.github.rey5137:material:1.2.2’ In Xml write this code. <com.rey.material.widget.Spinner android:id=”@+id/spinner_label” style=”@style/LightSpinner” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:gravity=”center” android:minWidth=”128dp” android:padding=”8dp” app:spn_label=”Spinner with arrow” /> In Java class write this code. Spinner spn_label = (Spinner) findViewById(R.id.spinner_label); String[] items = new String[20]; for (int i = 0; i < items.length; i++) { items[i] = “Item ” … Read more

[Solved] integrate zxing in own android app [closed]

The instructions in the blog post are incorrect, in at least one area. The following paragraph from Step #3: The project will not currently build. We need to add the core.jar file (that we produced in the previous step) into our project. Right-click on ZXing project –> properties –> Java Build Path –> Add External … Read more

[Solved] close and exit from my App in android

try to set listener on your exit Button ( in my example is : btn_exit ) your app will exit at all 🙂 public class testprj extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btn_exit = (Button) findViewById(R.id.btn1); btn_exit .setOnClickListener(new OnClickListener() { … Read more

[Solved] How to use OnClick in android programming [closed]

For doing some Action on Button Click following these Steps : STEP 1: Add a button in your Activity layout as: <Button android:id=”@+id/button_id_here” android:layout_width=”wrap_content” android:layout_height=”wrap_content”/> STEP 2: Add your NextActivity in AndroidManifest.xml as: <!– your other xml –> <application <!– your other xml –> <activity android:name=”.NextActivity” /> </application> STEP 3: In MainActivity code add a … Read more

[Solved] LogCat entry meaning 2

java.lang.NullPointerException at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394) ArrayAdapter<Comment> adapter = new ArrayAdapter<Comment>(this, android.R.layout.simple_list_item_1, values); values has at least one null object in it, which you cannot have. You can read through the source code and see this happens here: T item = getItem(position); if (item instanceof CharSequence) { text.setText((CharSequence)item); } else { text.setText(item.toString()); // Line 394, when item is … Read more

[Solved] What happens when EditText has a null? [closed]

If the EditText has no contents, it will return a blank string, or a “” In order to return with 0, simply set up an if statement: EditText editText = (EditText) mParent.findViewById(Rid_something); String string = editText.getText().toString().trim(); if (string.equals(“”)) { return “0”; } else { return string; } This will return 0 if blank, or the … Read more

[Solved] Multiple android apps [closed]

It is not a good practice to do so. If each app uses the same source code but different ressources, you should offer customization options within the main app. You won’t have good dev feedbacks by polluting the market this way. With customizations, you can reach as much users as you would with a 1000 … Read more

[Solved] how to translate text without using google api? [closed]

Usually when submit your App to Google Play you get an option to translate, I’m not sure on the working, but the other alternative is to translate all the text yourself and use separate values.xml for each lang. EDIT: Mygengo Translation APIMicrosoft Translator APIsSpeaklite Translate APIWebServiceX Translate API 8 solved how to translate text without … Read more

[Solved] i want to replace snackbar with alert dialog , how in kotlin? [duplicate]

You can find the official documentation here To implement an AlertDialog you need to use the AlertDialog.Builder class too setup the AlertDialog. Then you can use the .create() method to create the AlertDialog, and then finally .show() of AlertDialog class to show the dialog. val alertDialog: AlertDialog? = activity?.let { val builder = AlertDialog.Builder(it) builder.apply … Read more