Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8819145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:16:52+00:00 2026-06-14T05:16:52+00:00

In Android, I want to use a custom ProgressDialog box during login without a

  • 0

In Android, I want to use a custom ProgressDialog box during login without a title and message. I’m having trouble getting it to work.

I want it like the following gif (notice no title or message):

enter image description here

How can I apply this in my code?

The code I have (does not work):

<Progressbar
android:id="@+id/progressBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/progress_custom"
android:indeterminateOnly="false" />

This is my progress_custom.xml:

<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:pivotX="50%"
    android:pivotY="50%" >

    <shape
        android:innerRadiusRatio="4"
        android:shape="ring"
        android:thicknessRatio="5.333"
        android:useLevel="false" >

        <size
            android:height="18dip"
            android:width="18dip" />

        <gradient
            android:centerColor="#886688cc"
            android:centerY="0.50"
            android:endColor="#ff6688cc"
            android:startColor="#006688cc"
            android:type="sweep"
            android:useLevel="false" />
    </shape>

</animated-rotate>

I want it so that when I login, this ProgressDialog shows. Here is how I am using it:

public class MainSerenaActivity extends Activity {
    EditText uname;
    EditText pass;
    EditText server;
    Button login;
    String strUname;
    String unamePass;
    String strPass;
    String strServer;
    String strServer_fn;
    String unamepass;
    String uPass;
    String encPass;
    TextView reg_txt;
    MyApplication app;
    String passwde;
    ProgressDialog pd;
    CheckBox servercheck_btn;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // getActionBar().setDisplayHomeAsUpEnabled(true);

        uname = (EditText) findViewById(R.id.user_edt_lg);
        pass = (EditText) findViewById(R.id.pass_edt_lg);
        server = (EditText) findViewById(R.id.server);
        login = (Button) findViewById(R.id.login);
        servercheck_btn = (CheckBox) findViewById(R.id.checkBox1);
         pd=(ProgressBar)findViewById(R.id.progressBar2);
        login.setOnClickListener(new View.OnClickListener() {

            @SuppressLint("ShowToast")
            public void onClick(View v) {
                strUname = uname.getText().toString().trim();
                strPass = pass.getText().toString().trim();

                MyApplication.setUserID(strUname);
                MyApplication.setPassWord(strPass);

                if (isInternetAvailable()) {
                    if ((uname.getText().toString()).equals("")
                            && (pass.getText().toString()).equals("")) {

                        Toast toast = Toast.makeText(MainSerenaActivity.this,
                                "please enter username & password ",
                                Toast.LENGTH_LONG);
                        toast.show();

                    } else {

                        MyThread t = new MyThread(MainSerenaActivity.this, 0);
                        pd=ProgressDialog.show(MainSerenaActivity.this, "", "");


                        t.start();
                        Toast.makeText(MainSerenaActivity.this,
                                "Successfully login", Toast.LENGTH_SHORT)
                                .show();
                        uname.setText("");
                        pass.setText("");
                        server.setText("");
                        servercheck_btn.setChecked(false);
                    }
                }

                else {
                    Toast toast = Toast
                            .makeText(
                                    MainSerenaActivity.this,
                                    "No internet available.Please turn on the internet",
                                    Toast.LENGTH_LONG);
                    toast.show();

                }

            }

        });

    }

    public boolean isInternetAvailable() {
        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo netInfo = cm.getActiveNetworkInfo();
        if (netInfo != null && netInfo.isConnectedOrConnecting()) {
            return true;
        }
        return false;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    class MyThread extends Thread {
        Context con;
        int but;
        Intent in;

        MyThread(Context con, int but) {
            this.con = con;
            this.but = but;
        }

        public void run() {
            try {
                switch (but) {
                case 0:
                    in = new Intent(MainSerenaActivity.this, Second_Btn.class);
                    if (servercheck_btn.isChecked()) {
                        if ((server.getText().toString()).equals("")) {
                            Toast toast = Toast.makeText(
                                    MainSerenaActivity.this,
                                    "please enter server ", Toast.LENGTH_SHORT);
                            toast.show();
                        } else {
                            strServer = server.getText().toString().trim();
                            strServer_fn = "https://" + strServer;
                            MyApplication.setServer(strServer_fn);
                        }
                    } else {
                        if ((server.getText().toString()).equals("")) {
                            strServer_fn = url;
                            MyApplication.setServer(strServer_fn);
                        } else {
                            strServer = server.getText().toString().trim();
                            strServer_fn = url;
                            MyApplication.setServer(strServer_fn);
                        }

                    }
                    startActivity(in);

                    break;

                }
            }

            catch (Exception e) {
            }

            pd.dismiss();

        }
    }

}

But the gif still shows with Title and message. I want just the spinner, how do I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:16:53+00:00Added an answer on June 14, 2026 at 5:16 am

    First of all make an class of the Activity indocator.create the constructor like below.

    public ActivityIndicator(Context context) {
        super(context, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
        setContentView(R.layout.activityindicator_dialog);
    
        setCancelable(true);
    
        RelativeLayout main = (RelativeLayout) findViewById(R.id.main);
        main.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    
    }
    

    now where ever you want to set the progress dialog then put the below code. You will be getting the progress dialog customized.

    private static ActivityIndicator activityIndicator;
    public static void hideActivityViewer() {
        if (activityIndicator != null) {
            activityIndicator.dismiss();
        }
    }
    
    public static void showActivityViewer(Context context) {
        if (activityIndicator == null) {
            activityIndicator = new ActivityIndicator(context);
        }
        activityIndicator.show();
    }
    
    public static void clearDialogs() {
        activityIndicator = null;
    }
    

    And xml of the activity indicator is like following

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <RelativeLayout android:gravity="center"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:id="@+id/main" android:background="@drawable/overlay_bck">
        <TextView android:text="@string/loading"
            android:textSize="15sp" android:textColor="#FFFFFF" android:id="@+id/text"
            android:textStyle="bold" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:gravity="center_horizontal"></TextView>
        <ProgressBar android:id="@+id/progress" android:layout_below="@+id/text"
            style="@android:style/Widget.ProgressBar" android:layout_centerHorizontal="true"
            android:layout_width="wrap_content" android:layout_height="wrap_content" />
    </RelativeLayout>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use a custom font for my android application which I am
I want to use a custom media controller in my Android app and therefore
I'm making an Android game, and I want to use a custom font for
I am developing a game in android,I want use the services to play and
I'm writing simple filter in Android and want to use ExpandableListAdapter with check boxes.
In a Android application I want to use Scanner class to read a list
I want to use Gama component in Android to make our app good.I have
I want to use an SDK in android, but I don't want that SDK
I want to use ListView on earlier versions of Android within an AppWidget. RagnarRs
I want to use OpenCV 2.4.0 native code in Android 2.3.3. For that, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.