Found 1631 Articles for Android

How to sort string array in android listview?

Fendadis John
Updated on 26-Jun-2020 14:03:51

488 Views

This example demonstrate about How to sort string array in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show a sorted arrayStep 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.Arrays; public class MainActivity extends AppCompatActivity {    ListView list;    String[] array = {"2", "5", ... Read More

How to reverse of integer array in android listview?

Arushi
Updated on 26-Jun-2020 14:02:53

305 Views

This example demonstrate about How to reverse of integer array in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show reversed arrayStep 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class MainActivity extends AppCompatActivity {    ListView list;    int[] ... Read More

How to print number of words in textview in android?

Vikyath Ram
Updated on 26-Jun-2020 14:02:11

513 Views

This example demonstrate about How to print number of words in textview in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         In the above code, we have taken textview to show paragraph and toast will show the information about number of words.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    TextView ... Read More

How to print number of paragraphs in textview in android?

Anuradha Nanda
Updated on 26-Jun-2020 13:18:49

710 Views

This example demonstrate about How to print number of paragraphs in textview in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         In the above code, we have taken textview to show paragraph and toast will show the information about number of paragraphs.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    TextView ... Read More

How to print integer array in android Log?

Fendadis John
Updated on 26-Jun-2020 13:17:22

615 Views

This example demonstrate about How to print integer array in android Log.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show integer arrayStep 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class MainActivity extends AppCompatActivity {    ListView list;   ... Read More

How to print exception messages in android?

Arushi
Updated on 26-Jun-2020 13:06:25

1K+ Views

This example demonstrate about How to print exception messages in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         In the above code, we have taken textview to show exception message.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; public class MainActivity extends AppCompatActivity ... Read More

How to merge two arrays without duplication in android listview?

Vikyath Ram
Updated on 26-Jun-2020 13:05:56

471 Views

This example demonstrate about How to merge two arrays without duplication in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show array values.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; public class MainActivity extends AppCompatActivity { ... Read More

How to insert integer array in android listview?

Arushi
Updated on 26-Jun-2020 13:05:17

674 Views

This example demonstrate about How to insert integer array in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show integer array.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class MainActivity extends AppCompatActivity {    ListView list;    int[] array ... Read More

How to give on click listener for footer view in android listview?

Vikyath Ram
Updated on 26-Jun-2020 13:04:41

225 Views

This example demonstrate about How to give on click listener for footer view in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show array values.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Gravity; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; public class ... Read More

How to find common elements from arrays in android listview?

Fendadis John
Updated on 26-Jun-2020 12:53:14

104 Views

This example demonstrate about How to find common elements from arrays in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml         In the code, we have taken listview to show array values.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class MainActivity extends AppCompatActivity {    ListView ... Read More

Advertisements