[Solved] Get latitude and longitude from json data [closed]

Try with below code: JSONObject object = new JSONObject(YOUR RESPONSE STRING); JSONArray jArray = object.getJSONArray(“latlong”); for (int i = 0; i < jArray.length(); i++) { String lat = jArray.getJSONObject(i).getString(“lat”); String lon = jArray.getJSONObject(i).getString(“lon”); } 14 solved Get latitude and longitude from json data [closed]

[Solved] Log statement giving error on printing the value of Intent in android

build the Intent alike this: Intent intent = new Intent(activity, UserActivity.class); Bundle extras = new Bundle(); extras.putString(“Email”, email.getText().toString().trim()); extras.putString(“Name”, name_db); extras.putString(“User_Id”, user_id_db); extras.putString(“Contact”, contact_db); intent.putExtras(extras); startActivity(intent); while the List<String> contactNumber = db.getContactNumber() already seems unfortunate. it might be rather elegant to return some class Contact (to be defined) instead of a List<String> … so that … Read more

[Solved] How to insert and display an image in Android? [closed]

Replace this line: Picasso.with(AddAdsActivity.this).load(image).placeholder(R.drawable.camera).into(TuitionImage); With this: Picasso.get().load(image).placeholder(R.drawable.camera).into(TuitionImage); And that’s it.. Your error will be solved. 2 solved How to insert and display an image in Android? [closed]

[Solved] Card layout parameters not working

You can try this as one of the solution if you do not want to specify the dimension for width and height of Image <?xml version=”1.0″ encoding=”utf-8″?> <android.support.v7.widget.CardView android:id=”@+id/cvAdvertFavourite” xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:card_view=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_marginTop=”2dip” android:layout_marginBottom=”2dip” card_view:cardUseCompatPadding=”true” > <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”horizontal” android:padding=”8dp” > <ImageView android:id=”@+id/ivCardFavouriteAnimalPhoto” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginRight=”8dp” android:weight = “2”/> <RelativeLayout android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:weight … Read more

[Solved] Add a number to a textView using button onClick()

private int i = 0;// Declare i as private ….. TextView tv = (TextView)findViewById(R.id.tv01); Btn.setOnClickListener(new OnClickListener() { public void onClick(View v) { i = i+10; tv.setText( String.valueOf(i)); } }); 0 solved Add a number to a textView using button onClick()

[Solved] How can I make the my listview interactive? [duplicate]

Try this: listView = (ListView) findViewById(R.id.my_list_view); listView.setAdapter(someAdapter); listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch(position) { case 0: Intent intent = new Intent(); intent.setClassName(“com.test”, “com.test.SubMenuActivity”); startActivity(intent); break; case 1: // Do something else … break; // … } }); solved How can I make the my listview interactive? … Read more

[Solved] Worklight 6.1 – Barcode Scanner Plugin

Yaniv thanks. The problem was in CaptureActivity library. After importing “Existing Android Code Into Workspace”, I should BUILD the project library. Then it create a directory – “D:\Users\MyUser\workspaceNew\CaptureActivity\bin\” with “captureactivity.jar” file in it. Thanks! solved Worklight 6.1 – Barcode Scanner Plugin

[Solved] Using Android Studio, how can I create a value which will increase its value by 1 every time a button is clicked? [closed]

you need to add a button to your .xml file like this : <Button android:layout_width=”match_parent” android:layout_height=”wrap_content” android:text=”Goal” android:layout_margin=”8dp” android:onClick=”add1ForTeamA” android:id=”@+id/Three_Button_B”/> then if you will notice that the android:onclick has been set to the add1ForTeamA method. Go to the mainActivity.java file and add this method `public void addOneForTeamA(View view) { scoreTeamA = scoreTeamA + 1; displayForTeamA(scoreTeamA); … Read more