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

  • Home
  • SEARCH
  • 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 3343776
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:59:36+00:00 2026-05-18T00:59:36+00:00

i am trying to fetch the value in src and dest once the user

  • 0

i am trying to fetch the value in src and dest once the user clicks the navigate button but its always null. can some one plz help

static String source  = "currentLocation"; 
    static String destination  = null;

private void getSrcDest(){
        LayoutInflater factory = LayoutInflater.from(this);
        final View textEntryView = factory.inflate(R.layout.srcdest, null);
        final AlertDialog.Builder alert = new AlertDialog.Builder(this);
        alert.setIcon(R.drawable.srcdest_icon);
        alert.setTitle("Enter Source & Destination");
        alert.setView(textEntryView);
        final EditText sourceText = (EditText) findViewById(R.id.sourcetext);
        final EditText destinationText = (EditText) findViewById(R.id.desttext);

        alert.setPositiveButton("Navigate", new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            try{
                Toast.makeText(getApplicationContext(), sourceText.getText().toString()+destinationText.getText().toString(),
                        Toast.LENGTH_SHORT).show();
                source = sourceText.getText().toString();
                destination = destinationText.getText().toString();
                System.out.println("----------------Source:"+source);
                System.out.println("-----------Destination:"+destination);
            }
            catch(Exception e){
                System.out.println("----------------Source:"+source);
                System.out.println("-----------Destination:"+destination);
                //if(destination.equals(null)){
                    final AlertDialog.Builder wrongAddressAlert = new AlertDialog.Builder(MainActivity.this);
                    wrongAddressAlert.setTitle("Destination Address Cannot be Null");
                    wrongAddressAlert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            getSrcDest();
                        }
                    });
                    wrongAddressAlert.show();


            //}
                }   
            }


            });
        alert.setNegativeButton("Cancel",
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        dialog.cancel();
                    }
                });
        alert.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-18T00:59:37+00:00Added an answer on May 18, 2026 at 12:59 am

    I am assuming that you are having those edit text fields in srcdest.xml Layout. If yes, then you are initializing your edit texts in a wrong way. Try to initialize them this way:

    LayoutInflater factory = LayoutInflater.from(this);
        final View textEntryView = factory.inflate(R.layout.srcdest, null);
    
        final EditText sourceText = (EditText) textEntryView.findViewById(R.id.sourcetext);
        final EditText destinationText = (EditText) textEntryView.findViewById(R.id.desttext);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fetch Wikipedia pages using LWP::Simple , but they're not coming back.
I'm trying to fetch a value from a NSString that is between two specific
i am trying to acquire unix_timestamp value for a particular timestamp column. but i
I'm trying to fetch some HTML from various blogs and have noticed that different
I'm trying to fetch the last inserted row Id of a Sqlite DB in
Trying to make a make generic select control that I can dynamically add elements
I am trying to get my checkbox value to save on my dynamic created
I'm trying to get the maximum value for an attribute in an Entity in
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to get my css / C# functions to look like this: body {

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.