[Solved] Application unfortunately stopped on clicking bookmarked item in fragment view Im using json to store title & links

hello guys i used following code & my problem got solved listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Object o = listView.getAdapter().getItem(position); if (o instanceof Map) { final Map map = (Map) o; Intent in = new Intent(getActivity(),HomeFragment.class); in.putExtra(“url”, String.valueOf(map.get(TAG_LINK))); System.out.println(“loading url…”+String.valueOf(map.get(TAG_LINK))+” please wait”); HomeFragment.wv.post(new Runnable() { public … Read more

[Solved] Translation of Plus and Minus button previous and next to EditText Respectively Code that is in Kotlin to Java [closed]

So here is your code in Java: public class MainActivity extends AppCompatActivity implements View.OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.increase).setOnClickListener(this) findViewById(R.id.decrease).setOnClickListener(this) } public void increaseInteger() { display(Integer.parseInt(integer_number.getText().toString()) + 1); } public void decreaseInteger() { display(Integer.parseInt(integer_number.getText().toString()) – 1); } private fun display(int number) { integer_number.setText(String.valueOf(number)); } @Override protected void onClick(View v) { … Read more

[Solved] XML parsing error (android studio)

use this <?xml version=”1.0″ encoding=”utf-8″?> <android.support.v7.widget.Toolbar     xmlns:android=”http://schemas.android.com/apk/res/android”     xmlns:app=”http://schemas.android.com/apk/res-auto”     android:id=”@+id/toolbar”     app:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar”     android:layout_width=”match_parent”     android:layout_height=”wrap_content”     android:minHeight=”?attr/actionBarSize”     app:navigationContentDescription=”@string/abc_action_bar_up_description”     android:background=”?attr/colorPrimary”     app:navigationIcon=”?attr/homeAsUpIndicator”     app:title=”@string/action_settings”     /> this is another example <RelativeLayout     xmlns:android=”http://schemas.android.com/apk/res/android”     xmlns:app=”http://schemas.android.com/apk/res-auto”     android:orientation=”vertical”     android:layout_width=”match_parent”     android:layout_height=”match_parent”>       <android.support.v7.widget.Toolbar         android:id=”@+id/toolbar”         android:layout_width=”match_parent”         android:layout_height=”8dp”         android:minHeight=”?attr/actionBarSize”         android:background=”?attr/colorPrimary”         app:popupTheme=”@style/ThemeOverlay.AppCompat.Light”/>       <FrameLayout         android:id=”@+id/putPrefsContentHere”         android:layout_width=”match_parent”         android:layout_height=”wrap_content” />   </RelativeLayout> 4 solved XML parsing error (android studio)

[Solved] A_Class cannot be cast to B_Class?

Your class hierarchy is: class Home_Page extends AppCompatActivity class MainActivity extends AppCompatActivity This is similar to the following: class Dog extends Animal class Cat extends Animal You can cast a Dog to an Animal, but you can’t cast a Dog to a Cat. In the same way, you can’t cast a Home_Page to a MainActivity. … Read more

[Solved] Android Studio API 22 gives an error Unfortunately, “App Name” has stopped working after successful build [duplicate]

Try removing the android prefix in <item name=”android:windowNoTitle”>true</item> i.e replace it with <item name=”windowNoTitle”>true</item>. Also replace <style name=”MyMaterialTheme.Base” parent=”Theme.AppCompat.Light.DarkActionBar”> with <style name=”MyMaterialTheme.Base” parent=”Theme.AppCompat”> , the Light.DarkActionBar part is unnecessary as you are specifying windowActionbar as false and windowNoTitle as true and setting action bar in activity. Also one more thing, ActionBarActivity is deprecated in revision … Read more

[Solved] Choosing language at startup

If I understand you correctly you wish to display that activity only when the user runs the app for the first time. Well, here’s what you can do: 1) Get a handle to a SharedPreference. This is to store if the user has already selected the language or not. SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE); 2) Create … Read more

[Solved] What is an Activity in Android? [closed]

Can anyone please explain what is exactly an ‘Activity’ means in Android ? An activity is your main “coarse” unit of user interface. It is roughly analogous to a screen, page, window, or other similar construct in other GUI environments. Or, to quote the documentation: An Activity is an application component that provides a screen … Read more

[Solved] How do I keep Android Studio from stopping my app when I close Android Studio?

For anyone else who’s wondering, I figured it out. You simply have to disconnect the phone from your device first. For example, if it’s plugged into your PC for USB Debugging, simply unplug your phone before closing Android Studio. Or if you’re using Wireless Debugging, disconnect from your phone (or simply turn off Wireless Debugging) … Read more

[Solved] How to generate a TextView from a buttonclick event in Android Studio?

Try this out: TextView[] tv4 = new TextView[value1]; TextView[] tv5 = new TextView[value2]; for(int i=0;i<value1;i++){ tv4[i]=new TextView(Home.this); tv4[i] = new TextView(Home.this); tv4[i] .setText(“Test 1″+i); tv4[i] .setTextSize(20); tv4[i] .setTextColor(Color.BLUE); RelativeLayout.LayoutParams params4 = new RelativeLayout.LayoutParams((int)ViewGroup.LayoutParams.WRAP_CONTENT, (int)ViewGroup.LayoutParams.WRAP_CONTENT); params4.leftMargin = 200+(i+10); params4.topMargin = 280; tv4[i] .setLayoutParams(params4); rR.addView(tv4[i] ); } solved How to generate a TextView from a buttonclick event … Read more