Akshay kumar
Akshay kumar

Reputation: 102

How to make a progress dialog compatible with higher version of android

I am using a progress dialog in my app to load app contents. It was working good but when i am using this app in android lollipop or marshmallow, it is showing me a white dialog box with my progress dialog.

Upvotes: 3

Views: 1270

Answers (3)

Sreehari Ballampalli
Sreehari Ballampalli

Reputation: 3714

Try to use material design progress bar it will work fine with both higher and lower version of android. Refer below link for more information https://developer.android.com/reference/android/widget/ProgressBar.html

Upvotes: 1

Vignesh Ramachandra
Vignesh Ramachandra

Reputation: 92

Always use support library widgets to make it look consistent across various android versions. Hope it helps! :)

Upvotes: 0

Faraz
Faraz

Reputation: 2154

For material theme on all android versions, you have to use AppCompatActivity.

For Example,

In Activity say A

public class A extends AppCompatActivity
{
    ...
}

And in Manifest.xml,

<application
       ...
        android:theme="@style/AppThemeActionBar"
       ...
>
</application>

And in style.xml,

<!-- Base application theme. -->
    <style name="AppThemeActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

Make sure you add dependency in gradle,

compile 'com.android.support:appcompat-v7:23.1.1'

Upvotes: 1

Related Questions