[Solved] Android studio..i got an error while running the hello world on android studio 6 can you please solve it [closed]

You can try the following to get ADB working: First search for adb.exe in processes of task manager and end it and try to run application. If the above doesn’t work or you can’t see adb.exe in task manger go for the next way Open command prompt, give path of platform-tools and write following commands … Read more

[Solved] Parsing Json from server

JSONObject jObject = new JSONObject(response); JSONSONArray p = jObject.getJSONArray(“SizeOptions”); for(int i=0;i<p.length();i++) { JSONObject jObjectValue=p.getJSONObject(i); String name = jObjectValue.getString(“Name”); } 2 solved Parsing Json from server

[Solved] Android OnClick and OnclickListner

Why don’t you make mNsdUtils to be a member field if it should be accessed from the outside of the function? The root cause saying mNsdUtils is null from the MainActivity.onClickDiscover() implementation. Implement in the method itself, as the context is different throwing a null pointer exception. A small tip for you: read the stack … Read more

[Solved] using Gps Getting Latitude and Longitude

http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/ Go to this link to get your location You can implement a loop with postdelay handler to implement 5 minute refresh rate and run the getLocation inside that… Use SharedPreferenceManager to store the last known lat and long to the sdcard data https://mongskiewl.wordpress.com/2013/10/16/sending-json-data-from-android-to-a-php-script/ Follow this to send JSON data 🙂 4 solved using Gps … Read more

[Solved] cant add ImageView in a subclass [closed]

Since you don’t have a code posted, I have to guess. Instead of using this keyword, try to use MainActivity.this. If you have a subclass in your activity, you will most likely use the context of the running activity. 1 solved cant add ImageView in a subclass [closed]

[Solved] How to search nearby places with google API? [closed]

In Logcat your Places link is – https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=0.0,0.0&radius=5000&types=mosque&sensor=true&key=AIzaSyAEZ252ulUWkOIKtJw9O7JvrYz3RLp0N_c Notice the location parameter – your latitude and longitude values are 0.0 and google response is also NULL. So that you are not able to see places on map. Try to debug your latitude & longitude values and also check if your Location sensor (GPS) is on/off. … Read more

[Solved] Starting activity with button

import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.Toast; public class Contact extends Activity { public ImageView btnlog1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnlog1=(ImageView)findViewById(R.id.imageView2); btnlog1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent l = new Intent(Contact.this, AndroidDashboardDesignActivity.class); startActivity(l); Contact.this.finish(); } }); } … Read more

[Solved] Rubik’s cube Unity 5 [closed]

Your question is not very clear. Even if English isn’t your first language, code is international. Please try to post what you’ve done so far. We don’t know if you can render your cube, how the objects are organised or how they should be animated. In short, you will need to complete at least some … Read more

[Solved] OnClick button replacing fragment many times with FragmentTransaction, ignoring Tag

This line of code is misplaced: Fragment fragment = fm.findFragmentByTag(MAIN); You have it outside of the onClick() method, which means that the value of fragment is determined once (when you create/assign the OnClickListener) and then reused every time the button is clicked. Just move that line inside the onClick() method: @Override public void onClick(View view) … Read more

[Solved] Android login showing error

Use this login.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (username.getText().toString().equals(“admin”) && password.getText().toString().equals(“admin”)) { Intent i = new Intent(Login.this, MainActivity.class); startActivity(i); } else { } } }); solved Android login showing error

[Solved] Change Button Text on Button Click Infinite times [closed]

To accomplish what you want, globally declare an integer with a value 0. And inside onClick of button increment the value of integer and set that as text to button. Sample Code: Globally declare: int count = 0; Inside onCreate(): button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { count++; button.setText(“”+count); } }); 8 solved … Read more

[Solved] How to start activity with two buttons

Try this public class MainActivity extends AppCompatActivity { Boolean launch = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btn1 = (Button) findViewById(R.id.button); Button btn2 = (Button) findViewById(R.id.button2); btn1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { launch = true; } }); btn2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (launch … Read more