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

Guys i have a requirement to list all the dates of the previous month
I have a requirement to save an image file in various formats. The list
We have a requirement in project to store all the revisions(Change History) for the
I have a requirement to make a large amount of code MISRA compliant. First
I have a sales simulator written in C#. I did not write this however
I'm trying to find a way to list the (static) dependency requirements of a
A requirement for an ASP.Net 2.0 project I'm working on limits a certain field
My requirement is I have server J2EE web application and client J2EE web application.
My requirement is just to display a set of values retrieved from database on
My requirement is to develop a page with 4 sections, which cannot have a

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.