Found 1631 Articles for Android

How to set heap watch limit in android?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

79 Views

This example demonstrates How to set heap watch limit 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 text view to show heap status.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity {   ... Read More

How to implement click event on toolbar icon?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrates How to implement click event on toolbar icon.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 text view to action bar icon status.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.annotation.SuppressLint; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; import android.view.View; ... Read More

How to use compareTo () in Android textview?

Anvi Jain
Updated on 30-Jul-2019 22:30:25

206 Views

This example demonstrate about How to use compareTo () in Android textview.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 name as Edit text, when user click on button it will take data and compare with sairam string.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.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to get subtitle of action bar in android?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

74 Views

This example demonstrates How to get subtitle of action bar 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 text view to show status bar sub tittle.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class ... Read More

How to use charAt() in Android textview?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

319 Views

This example demonstrates about How to use charAt() in Android text view.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 the name as Edit text, when user clicks on the button it will take data and find 5th character.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.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to get launcher thumbnail size in android?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

88 Views

This example demonstrates How to get launcher thumbnail size 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 text view to show activity launcher thumbnail size.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity ... Read More

How to get current status bar elevation in android?

Nitya Raut
Updated on 30-Jul-2019 22:30:25

202 Views

This example demonstrates How to get current status bar elevation 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 text view to show status bar elevation.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity ... Read More

How to use contains () in Android text view?

Anvi Jain
Updated on 30-Jul-2019 22:30:25

865 Views

This example demonstrate about How to use contains () in Android text view.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 name as Edit text, when user click on button it will take data and compare with tutorialspoint string.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.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to get current state of activity in android?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

596 Views

This example demonstrates How to get current state of activity 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 text view to show activity state.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { ... Read More

How to get current activity name in android?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

4K+ Views

This example demonstrates How to get current activity name 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 text view to show activity name.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity {   ... Read More

Advertisements