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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:55:26+00:00 2026-05-25T06:55:26+00:00

this is my first app and it’s a present for android people in Serbia…i’m

  • 0

this is my first app and it’s a present for android people in Serbia…i’m not charging it. I finished it, but I have some problems. First problem is:
My first screen is alert dialog where I explained to user’s what thay need to run my app. The problem is when i start my app again when(i guess) is destroyed from android system it dont show alert dialog. It shows an empty screen.I go out on home button come again and now it all okey. What’s wrong??? Any idea?
Second problem is: My classes are all in one folder:src/test/projekat. When i start my app on phone it installs all 4 files which represent my 4 activitys in manifest. Is this the way it should happen??? Thanks a lot…
EDITED ALERT DIALOG CODE:

public class PronadjiKlopuActivity extends Activity {
    /** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //Kreira AlertDialog sa dva dugmeta koji ce se pojaviti pri aktiviranju aplikacije
        AlertDialog ad = new AlertDialog.Builder(this).create();
        ad.setTitle("Vasa trenutna lokacija");
        ad.setMessage("Da bi ste koristili aplikaciju potrebno je da ukljucite internet konekciju i dozvolite koriscenje GPS satelita i wireless mreze za dobijanje lokacije.");
//        ad.setMessage("Da bi ste koristili aplikaciju potrebno je da dozvolite ocitavanje vase trenutne lokacije.");
        ad.setButton(DialogInterface.BUTTON_POSITIVE, "Dozvoli", new DialogInterface.OnClickListener() {

            //Klikom na dugme Dozvoli otvara se novi prozor
            @Override
            public void onClick(DialogInterface ad, int which) {
                Intent i = new Intent(PronadjiKlopuActivity.this, TrenutnaLokacija.class);              
                startActivity(i);               
            }
        });

        ad.setButton(DialogInterface.BUTTON_NEGATIVE, "Ne dozvoli",new DialogInterface.OnClickListener() {

            //Klikom na dugme Ne dozvoli aplikacija se zatvara
            @Override
            public void onClick(DialogInterface dialog, int which) {
                finish();

            }
        });

        //Mesto na kojem ce se pojaviti dialog
        WindowManager.LayoutParams wMLP = ad.getWindow().getAttributes();
        wMLP.x = 100;
        wMLP.y = 200;
        ad.getWindow().setAttributes(wMLP);
        ad.show();



    }

    //U slucaju pritiska dugmeta Back gasi se aplikacija
    @Override
    public void onBackPressed() {
//      Intent i = new Intent(Intent.ACTION_MAIN);
//      i.addCategory(Intent.CATEGORY_HOME);    
//      startActivity(i);
        finish();
        super.onBackPressed();
    }

    @Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
    }
  • 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-25T06:55:27+00:00Added an answer on May 25, 2026 at 6:55 am
    When i start my app on phone it installs all 4 files which represent my 4 activitys in manifest. Is this the way it should happen???
    

    you have added this property in each of your activity tag in your manifest file:

    <category android:name="android.intent.category.LAUNCHER" />
    

    you should add this property to your activity in manifest which will be first one when your app starts..

    for your alertDialog show your code..

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

Sidebar

Related Questions

This is my first android app and I'm a little disapponted because I'm not
This is my first Android app. I need to email what I have so
I have my first app, not that big, but it is the first step.
This is my first winform app in .NET... I have made a couple of
How to create in-app step by step instructions? Like this ( first boot android
Bear with me, as this is my first Android app. :) Essentially, I would
We've had some good experiences building an app on Google App Engine, this first
I am trying to create my first Android app and need some help. Basically
This is my first MVC app and I'm not sure how to use a
This is my first android app. I am posting the code I am using

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.