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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:59:58+00:00 2026-05-31T03:59:58+00:00

I am newbie in android development. I am good at Java, but not Android

  • 0

I am newbie in android development. I am good at Java, but not Android API. This is my testing program for job application, so I need help to solve issue. I made dialog box, which is called by pressing button, but I can’t reach dialog’s textview (app crashes when i try to reach it – NullPointerException) even Eclipse IDE don’t find any problem. I include almost all code, because I don’t know what to exclude

custom_dialog.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/layout_root"
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:padding="10dp"
          >
    <TextView android:id="@+id/dlgText"
              android:layout_width="fill_parent"
              android:layout_height="50dp"
              android:textColor="#FFF"
              />
</LinearLayout>

BalticAmadeusActivity.java

public class BalticAmadeusActivity extends Activity{
    /** Called when the activity is first created. */
    Button btnApie;
    Button btnForma;
    Dialog dlgApie;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        btnApie = (Button) findViewById(R.id.btnApie);
        btnForma = (Button) findViewById(R.id.btnForma);
        btnApie.setOnTouchListener(new OnTouchListener() {

            @Override
            public boolean onTouch(View v, MotionEvent event) {
                // TODO Auto-generated method stub
                if (v.equals(btnForma)) {
                    btnForma();
                } else if (v.equals(btnApie)) {
                    btnApie();
                }
                return false;
            }
        });
        dlgApie = new Dialog(this.getApplicationContext(), android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
        dlgApie.setContentView(R.layout.custom_dialog);
        TextView dlgText = (TextView) findViewById(R.id.dlgText);  
        dlgText.setText("Gera uzduotis"); //at this line, app crashes

        //dlgText.setText("U\u017Eduotis s\u0117kmingai \u012Fgyvendinta");
    }

    private void btnApie() {
        // TODO Auto-generated method stub
        dlgApie.show();
    }

    private void btnForma() {
        // TODO Auto-generated method stub

    }
}
  • 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-31T04:00:00+00:00Added an answer on May 31, 2026 at 4:00 am

    Search in the dialog layout(right now you are searching in the activity layout):

    TextView dlgText = (TextView) dlgApie.findViewById(R.id.dlgText); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi am newbie to android development. I had created one application where i need
Hey am a newbie to Android development. I need an application to test the
I am newbie to Android development and this webview and webview client is killing
I'm a newbie to the Android development world but have some experience with embedded
Extreme Android developer newbie here...well, new to Android development, not development in general. I
I'm a newbie on android development. I've been working on this app for my
I am a newbie to Android application development. I am reading the ToDo tutorial.
I'm newbie in Android application development. I just downloaded all SDks and Eclispe. Then
I am newbie in android application development. I am using the Form Stuff example
I'm newbie to Android development. I'm having problem here and hope someone could help

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.