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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:09:02+00:00 2026-05-24T01:09:02+00:00

My requirement is : List all sales route & highlight default, It should be

  • 0

My requirement is : List all sales route & highlight default, It should be first option. If the salesperson select other option(not selected default), then popup window should come. The popup window contain one form, it talk to DB.After submit the popup window form , it return previous screen , It need to allow to go other position.

See my code

This initial list Activity:

    ArrayList<Object> routeList = getWmRoute();
    ArrayList<String> routhPath = new ArrayList<String>();
    for(int i = 0; i<routeList.size();i++){
        routhPath.add(((WMRoute) routeList.get(i)).getDescription());
    }

    ArrayAdapter ad = new ArrayAdapter(this,android.R.layout.simple_list_item_single_choice,routhPath);
    setListAdapter(ad);
    final ListView list=getListView();
    list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    list.setItemsCanFocus(true);
    list.setTextFilterEnabled(true);
    list.setItemChecked(0,true);
    list.setSelection(0);

This is listener method

   @Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    if(position !=0 ){
        Bundle bundle = new Bundle();
        int postion = position;
        String aString = Integer.toString(postion);
        bundle.putString("positon", aString);
        Intent showContent = new Intent(getApplicationContext(),SalesRouteDevitionActivity.class);
        // startActivityForResult(showContent,0);
        startActivity(showContent);

    }
}

This is my SalesRouteDevitionActivity class

   array_spinner=new String[2];
    array_spinner[0]="Rain";
    array_spinner[1]="Floods";
    Bundle bundle = this.getIntent().getExtras();
    param1 = bundle.getString("param1");

    Spinner s = (Spinner) findViewById(R.id.spinner1);
    ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, array_spinner);
    s.setAdapter(adapter);
     final Button button = (Button) findViewById(R.id.submit);

     button.setOnClickListener(new OnClickListener() {
         public void onClick(View v) {
             Toast.makeText(SalesRouteDevitionActivity.this, "Beep Bop", Toast.LENGTH_SHORT).show();
             Intent showContent = new Intent(getApplicationContext(),SalesRouteActivity.class);

             Bundle bundle = new Bundle();
             bundle.putString("position", param1);
             Intent mIntent = new Intent();
             mIntent.putExtras(bundle);
             setResult(RESULT_OK, mIntent);
             finish();
            startActivity(showContent);


         }
     });

This is my manifest file

  <activity android:theme="@android:style/Theme.Dialog" android:name=".SalesRouteDevitionActivity"
              android:label="Sales Route Diviation">
    </activity>

After finish pop window work , how we can go to previous activity that particular place?

Please help me…

Thanks in advance

  • 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-24T01:09:03+00:00Added an answer on May 24, 2026 at 1:09 am

    from wherever you start the popup window call it using intent throught call this startActivityForResult(your_intent,requestCode)

    it will start the activity and in the popup activity do like this way

    Bundle bundle = new Bundle();
    bundle.putString("position", param1);
    
    Intent mIntent = new Intent();
    mIntent.putExtras(bundle);
    setResult(RESULT_OK, mIntent);
    finish();
    

    so the popup will finish his activity and go back to previous activity where it will invoked with the result

    and in your activity override the onActivityResult like this way

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode==1){
            if(resultCode==RESULT_OK)
                Toast.makeText(this, "SUCCESS", Toast.LENGTH_LONG).show();
           else
              Toast.makeText(this, "Fail", Toast.LENGTH_LONG).show();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SQL Server 2005. I have a requirement to list out all
I have requirement where when a user enter new item in a list first
There is a requirement to have not-so-trivial dynamic list, each record of which consists
Guys i have a requirement to list all the dates of the previous month
I have a requirement of reading a text file which contains list of all
I have a list view that show a list of items...well not all of
The requirement is that the admin will select the date format from the list
Design requirement: Show a list of items the user can pick from After having
I have a requirement to store the list of services for multiple computers. I
I have requirement to get Facebook friends list with their images. How can 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.