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 7402015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:37:53+00:00 2026-05-29T04:37:53+00:00

When I use startActivity(Intent) to load an activity with the theme set to Theme.Dialog

  • 0

When I use startActivity(Intent) to load an activity with the theme set to Theme.Dialog my application shows a Toast notification with the android:label for the new activity. Is there a way to turn this off? I noticed if I run a progress dialog in the onCreate of the new activity it doesn’t popup the Toast message but I don’t want the progress dialog or the Toast message.

I call the activity with:

Intent queriesIntent = new Intent(getApplicationContext(), GetQueriesPopup.class);
startActivity(queriesIntent);

And my activity with the Theme.Dialog:

public class GetQueriesPopup extends ListActivity {
private static String server;
private static String suffix;
private static String project;
private static int qid;
private static String[] qidsArray;
private static String username;
private String[] queries;
private ProgressDialog mDialog;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
    server = app_preferences.getString("server", "none");
    username = app_preferences.getString("username", "none");
    project = app_preferences.getString("project", "none");
    try
    {
        GetMap.showProgressDialog(true);
        getRequest();
    }
    catch(Exception ex)
    {
        GetMap.showProgressDialog(false);
        AlertDialog alertDialog = new AlertDialog.Builder(this).create();
        alertDialog.setTitle("GTWeb");
        alertDialog.setMessage("Couldn't get a list of available queries, please check internet connection.");
        alertDialog.setButton("OK", new DialogInterface.OnClickListener() 
        {
            @Override
            public void onClick(DialogInterface dialog, int which) 
            {
                Intent intent = null;
                intent = new Intent(getApplicationContext(), GTWeb.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
            }
        });
        alertDialog.show();
    } 

}

        public void getRequest()
{
    if (server.endsWith("/"))
    {
        suffix = "queries.aspx?usr=" + username + "&prj=" + project;
    }   
    else
    {
        suffix = "/queries.aspx?usr=" + username + "&prj=" + project;
    }
    String url = server + suffix;
    new HttpConnection().execute(url);
}

public void finishConnection(HttpConnection httpConn)
{
    GetMap.showProgressDialog(false);
    httpConn.cancel(true);
    final SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
    try
    {
        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, queries));
        LayoutParams dialogParams = this.getWindow().getAttributes();
        dialogParams.height = 500;
        dialogParams.width = 500;
        dialogParams.gravity = Gravity.BOTTOM | Gravity.LEFT;
        dialogParams.dimAmount = 0;
        this.getWindow().setAttributes(dialogParams);
        }
    catch(Exception ex)
    {
        Log.e("QueryFragment Exception", ex.toString());
        AlertDialog alertDialog = new AlertDialog.Builder(this).create();
        alertDialog.setTitle("GTWeb");
        alertDialog.setMessage("Couldn't get a list of available queries, please check internet connection.");
        alertDialog.setButton("OK", new DialogInterface.OnClickListener() 
        {
            @Override
            public void onClick(DialogInterface dialog, int which) 
            {
                Intent intent = null;
                intent = new Intent(getApplicationContext(), GTWeb.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
            }
        });
        alertDialog.show();
    } 
    final ListView lv = getListView();
    lv.setOnItemClickListener(new OnItemClickListener() 
    {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) 
        {
            qid = position;
            SharedPreferences.Editor editor = app_preferences.edit();
            Intent myIntent = null;

myIntent = new Intent(view.getContext(), GetPromptsPopup.class);
                editor.putInt("qid", Integer.valueOf(qidsArray[qid]));
                editor.putBoolean("location", false);
                editor.commit();
                startActivityForResult(myIntent, 1);
            }   

    });
}

protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    if (resultCode == RESULT_OK)
    {
        if (data.getBooleanExtra("finish", false))
        {
            this.finish();
        }
    }
}


private class HttpConnection extends AsyncTask<String, Void, String[]>
{
    protected String[] doInBackground(String... url)
    {
        int TIMEOUT_MILLISEC = 10000; //=10sec
        HttpParams my_httpParams = new BasicHttpParams();;
        HttpConnectionParams.setConnectionTimeout(my_httpParams,
                TIMEOUT_MILLISEC);  //set conn time out
        HttpConnectionParams.setSoTimeout(my_httpParams, TIMEOUT_MILLISEC);

        HttpClient client = new DefaultHttpClient(my_httpParams);
        String userAgent = "GTI;Android;" + Build.VERSION.SDK_INT;
        client.getParams().setParameter(CoreProtocolPNames.USER_AGENT, userAgent);
        HttpGet request = new HttpGet(url[0]);
        String[] txtResponse = null;
        try{
            HttpResponse response = client.execute(request);
            txtResponse = TestHttpGet.requestQueries(response);
        }catch(Exception ex){
            Log.e("QueryFragment Exception @HttpConnection", ex.toString());
        }
        return txtResponse;
    }


    protected void onPostExecute(String[] theResults)
    {
        try
        {
        queries = new String[theResults.length];
        qidsArray = new String[theResults.length];
        for (int i = 0; i < theResults.length; i++)
        {
            String[] tempQueries = theResults[i].split("\\|", -1);
            if (tempQueries.length > 1)
            {
                qidsArray[i] = tempQueries[0];
                queries[i] = tempQueries[1];
            }
        }
        //          queries = theResults;
        finishConnection(this);
        }
        catch (Exception ex)
        {
            Log.e("QueryFragment Exception", ex.toString());
            AlertDialog alertDialog = new AlertDialog.Builder(getApplicationContext()).create();
            alertDialog.setTitle("GTWeb");
            alertDialog.setMessage("Couldn't get a list of available queries, please check internet connection.");
            alertDialog.setButton("OK", new DialogInterface.OnClickListener() 
            {
                @Override
                public void onClick(DialogInterface dialog, int which) 
                {
                    Intent intent = null;
                    intent = new Intent(getApplicationContext(), GTWeb.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    startActivity(intent);
                }
            });
            alertDialog.show();
        }
    }
}
  • 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-05-29T04:37:54+00:00Added an answer on May 29, 2026 at 4:37 am

    I found out that it was actually the title of the listActivity showing before I moved/loaded the list. I haven’t found a way to get rid of it so I covered it with a ProgressDialog.

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

Sidebar

Related Questions

I use the following code: uri = geo:+lat+,+lon; intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent);
Whenewer I want to start new activity, I use this code: Intent myIntent1 =
I try use below code to load an URL. URL url = new URL(urlstr);
I am trying to use an intent to send an email from my application
I have three activities in my application ... I use an intent to navigate
I try to use a progress dialog. My code: //Method to load data wire
Now i can use the share intent to open the share dialog Intent intent
I am new to Android development. I am trying to use the following code
I want make simple call app. I use this code. Intent intent = new
I have a function for opening a new activity, but I wan't to use

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.