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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:12:51+00:00 2026-06-16T01:12:51+00:00

when i start my apps my application is force to close and gives error

  • 0

when i start my apps my application is force to close and gives error of view not attached to window manager i dont understand what exactly error try to say
i was put my code here with logcat error

Logcat Error

12-19 18:28:06.258: E/WindowManager(5960): Activity com.example.vixxa.HomeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@419d0390 that was originally added here
12-19 18:28:06.258: E/WindowManager(5960): android.view.WindowLeaked: Activity com.example.vixxa.HomeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@419d0390 that was originally added here
12-19 18:28:06.258: E/WindowManager(5960):  at android.view.ViewRootImpl.<init>(ViewRootImpl.java:349)
12-19 18:28:06.258: E/WindowManager(5960):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:267)
12-19 18:28:06.258: E/WindowManager(5960):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:215)
12-19 18:28:06.258: E/WindowManager(5960):  at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:140)
12-19 18:28:06.258: E/WindowManager(5960):  at android.view.Window$LocalWindowManager.addView(Window.java:537)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.Dialog.show(Dialog.java:285)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ProgressDialog.show(ProgressDialog.java:116)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ProgressDialog.show(ProgressDialog.java:99)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ProgressDialog.show(ProgressDialog.java:94)
12-19 18:28:06.258: E/WindowManager(5960):  at com.example.vixxa.HomeActivity.onCreate(HomeActivity.java:370)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.Activity.performCreate(Activity.java:4492)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3351)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ActivityThread.access$700(ActivityThread.java:123)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151)
12-19 18:28:06.258: E/WindowManager(5960):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-19 18:28:06.258: E/WindowManager(5960):  at android.os.Looper.loop(Looper.java:137)
12-19 18:28:06.258: E/WindowManager(5960):  at android.app.ActivityThread.main(ActivityThread.java:4424)
12-19 18:28:06.258: E/WindowManager(5960):  at java.lang.reflect.Method.invokeNative(Native Method)
12-19 18:28:06.258: E/WindowManager(5960):  at java.lang.reflect.Method.invoke(Method.java:511)
12-19 18:28:06.258: E/WindowManager(5960):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-19 18:28:06.258: E/WindowManager(5960):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-19 18:28:06.258: E/WindowManager(5960):  at dalvik.system.NativeStart.main(Native Method)
12-19 18:28:06.258: E/wifienabled(5960): wifitrue

HomeActivity.java

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

            wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
            Log.e("wifienabled","wifi"+wifiManager.isWifiEnabled());


                gps = new GPSTracker(HomeActivity.this);
                // check if GPS enabled
                if(gps.canGetLocation())
                {
                        latitude = gps.getLatitude();
                        longitude = gps.getLongitude();         // \n is for new line
                 Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show();
             }


            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); 
            StrictMode.setThreadPolicy(policy); 

            alertDialog = new AlertDialog.Builder(this).create(); 
            flightalertDialog = new AlertDialog.Builder(this).create();
            loginalertDialog=new AlertDialog.Builder(this).create();

            if(CheckConnection.getInstance(this).isOnline(this))
            {
                progressdialogflight = ProgressDialog.show(HomeActivity.this, "Loading...", "Please Wait");


                 int displaymode=getResources().getConfiguration().orientation;
                    if(displaymode==1)
                    {
                        policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); 
                        StrictMode.setThreadPolicy(policy); 
                         new FlightListBack().execute("");
                        Log.e("Home", "You are  online!!!!");
                        Toast.makeText(this,"You are online!!!!",2000).show();

                    }
                    else
                    {

                         policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); 
                         StrictMode.setThreadPolicy(policy);
                         new FlightListBack().execute("");
                        Toast.makeText(this,"You are  online!!!!",2000).show();

                    }

            }
            else
            {
                Toast.makeText(this,"You are not online!!!!",2000).show();
                //alert();
            }


        int displaymode=getResources().getConfiguration().orientation;
        if(displaymode==1)
        {
            setContentView(R.layout.homeportrait);

            scrollView =(ScrollView)findViewById(R.id.scrollView);
             scrollView.setOnTouchListener(new View.OnTouchListener() {
             public boolean onTouch(View arg0, MotionEvent event)
            {
                findViewById(R.id.scrollView).getParent().requestDisallowInterceptTouchEvent(false);
                Log.e("SCroll View Touch","Work");
                return false;
            }
            });

            ListView lv =getListView();
            lv.setOnTouchListener(new View.OnTouchListener() {

                public boolean onTouch(View v, MotionEvent event)
                {
                    Log.e("ListView","Work");
                                        // Disallow the touch request for parent scroll on touch of child view
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                    return false;
                }
            });
        }
        else
        {
            setContentView(R.layout.home);


            scrollView =(ScrollView)findViewById(R.id.scrollView);

            scrollView.setOnTouchListener(new View.OnTouchListener() {
             public boolean onTouch(View arg0, MotionEvent event)
            {
                findViewById(R.id.scrollView).getParent().requestDisallowInterceptTouchEvent(false);
                Log.e("SCroll View Touch","Work");
                return false;
            }
            });

            ListView lv =getListView();
            lv.setOnTouchListener(new View.OnTouchListener() {

                public boolean onTouch(View v, MotionEvent event)
                {
                    Log.e("ListView","Work");
                                        // Disallow the touch request for parent scroll on touch of child view
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                    return false;
                }
            });



        }


        radiogroupsettings= (RadioGroup) findViewById(R.id.radiogroupsettings);

        editusername=(EditText)findViewById(R.id.editusername);
        editpassword=(EditText)findViewById(R.id.editpassword);
        headergobutton=(Button)findViewById(R.id.headergobutton);

        imageslider = (ImageView)findViewById(R.id.imageslider);
        imagefacebook_icon=(ImageView)findViewById(R.id.imagefacebookicon);
        imagetwitter_icon=(ImageView)findViewById(R.id.imagetwittericon);
        imageyoutube_icon=(ImageView)findViewById(R.id.imageyoutubeicon);

        imageappsheader=(ImageView)findViewById(R.id.imageappsheader);
        imagevisitor = (ImageView)findViewById(R.id.imagevisitor);
        imagerestaurant =(ImageView)findViewById(R.id.imagerestaurant);
        imageclubs =(ImageView)findViewById(R.id.imageclubs);
        imagespa =(ImageView)findViewById(R.id.imagespa);
        imagedeals=(ImageView)findViewById(R.id.imagedeals);
        imageshopping=(ImageView)findViewById(R.id.imageshopping);
        imagemagazine=(ImageView)findViewById(R.id.imagemagazine);
        imageairport =(ImageView)findViewById(R.id.imageairport);
        imageairport.setOnClickListener(this);
        imagehotel =(ImageView)findViewById(R.id.imagehotel);
        imagecategory=(ImageView)findViewById(R.id.imagecategory);
        imagecarrental=(ImageView)findViewById(R.id.imagecarrental);
        imagestation =(ImageView)findViewById(R.id.imagestation);

        imagefooter=(ImageView)findViewById(R.id.imagefooter);

        DisplayMetrics displaymetrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);

        height = displaymetrics.heightPixels;
        width = displaymetrics.widthPixels;

        headergobutton.setOnClickListener(this);

        imagegooglesearch=(ImageView)findViewById(R.id.imagegooglesearch);
        imagegooglesearch.setOnClickListener(this);

        imageyahoo=(ImageView)findViewById(R.id.imageyahoo);
        imageyahoo.setOnClickListener(this);

        imageespn=(ImageView)findViewById(R.id.imageespn);
        imageespn.setOnClickListener(this);

        imageamazon=(ImageView)findViewById(R.id.imageamazon);
        imageamazon.setOnClickListener(this);

        imageyoutube=(ImageView)findViewById(R.id.imageyoutube);
        imageyoutube.setOnClickListener(this);

        imagenetflix=(ImageView)findViewById(R.id.imagenetflix);
        imagenetflix.setOnClickListener(this);

        imagehulu=(ImageView)findViewById(R.id.imagehulu);
        imagehulu.setOnClickListener(this);

        imagelive365=(ImageView)findViewById(R.id.imagelive365);
        imagelive365.setOnClickListener(this);

        imagefacebook=(ImageView)findViewById(R.id.imagefacebook);
        imagefacebook.setOnClickListener(this);

        imageskype=(ImageView)findViewById(R.id.imageskype);
        imageskype.setOnClickListener(this);

        imagegames=(ImageView)findViewById(R.id.imagegames);
        imagegames.setOnClickListener(this);

        imagewifi=(ImageView)findViewById(R.id.imagewifi);
        imagewifi.setOnClickListener(this);

     //   buttontime=(Button)findViewById(R.id.buttontime);
     //  buttontime.setOnClickListener(this);
        // user layout textview in android

        textviewcity=(TextView)findViewById(R.id.textviewcity);
        textviewinfo=(TextView)findViewById(R.id.textviewinfo);
        textviewairport=(TextView)findViewById(R.id.textviewairport);

        text1=(TextView)findViewById(R.id.text1);
        text2=(TextView)findViewById(R.id.text2);
        text3=(TextView)findViewById(R.id.text3);
        text4=(TextView)findViewById(R.id.text4);
        text5=(TextView)findViewById(R.id.text5);
        text6=(TextView)findViewById(R.id.text6);


        //********** For Image Slide Image automatically Change *****************************

        final int []sliderImageArray={R.drawable.banner,R.drawable.banner01,R.drawable.banner02};
        final int []footerImageArray={R.drawable.bottomadv,R.drawable.sandwich,R.drawable.underbig};
        try 
        {

            Log.e("Land Scape Run","");
            Log.e("LandScape  Run","Handler ");
                final Handler imagehandler = new Handler();

                Runnable runnable;

                runnable = new Runnable()
                {

                    int i=0;
                    public void run()
                    {   // slider image run
                        imageslider.setImageResource(sliderImageArray[i]);  //Log.e("Image Run",""+sliderImageArray[i]);
                        i++;
                        if(i>sliderImageArray.length-1)
                        {
                                i=0;    
                                clear();
                        }
                        imagehandler.postDelayed(this, 4000); // for interval
                    }

                };
                imagehandler.postDelayed(runnable,10);

                final Handler footerimagehandler =new Handler();
                runnable = new Runnable()
                {   
                    int j=0;
                    public void run()
                    {   // footer image run
                        imagefooter.setImageResource(footerImageArray[j]); //   Log.e("Image Run",""+footerImageArray[j]);
                        j++;
                        if(j>footerImageArray.length-1)
                        {
                                j=0;    
                                clear();
                        }
                        footerimagehandler.postDelayed(this, 5000); // for interval
                    }
                };

                footerimagehandler.postDelayed(runnable, 10);


                // For ListView Change after 10 seconds;

                final Handler departurehandler =new Handler();
                runnable = new Runnable()
                {   

                    public void run()
                    {   

                        if(CheckConnection.getInstance(HomeActivity.this).isOnline(HomeActivity.this))
                        {

                                if(cheklist==0)
                                {   
                                                //Log.e("departure before chek List", "chek-->"+cheklist);
                                                 cheklist=1;
                                                // Log.e("departure  after chek List", "chek-->"+cheklist);
                                                if(!flightList.isEmpty())
                                                {

                                                                Log.e("listhandler departure","work");
                                                                int displaymode=getResources().getConfiguration().orientation;
                                                                if(displaymode==1)
                                                                {

                                                                        text1.setText("Destination");
                                                                        text4.setText("Schedule");
                                                                        textviewcity.setText(textcity);
                                                                        textviewairport.setText(textairport);
                                                                        textviewinfo.setText("Departure Flight List");

                                                                        ListAdapter departureadapter = new SimpleAdapter(HomeActivity.this,flightList,
                                                                                R.layout.listportrait,
                                                                                new String[] { TAG_MDESTINATION, TAG_MFLIGHT, TAG_MAIRLINE,TAG_MSCHEDULE,TAG_MTERMINALGATE,TAG_MFSTATUS  }, new int[] {
                                                                                        R.id.textdestination, R.id.textflight, R.id.textairline,R.id.textschedule,R.id.texttermgate,R.id.textstatus });
                                                                        setListAdapter(departureadapter);

                                                                }
                                                                else
                                                                {
                                                                            text1.setText("Destination");
                                                                            text4.setText("Schedule");  
                                                                           textviewcity.setText(textcity);
                                                                           textviewairport.setText(textairport);
                                                                           textviewinfo.setText("Departure Flight List");

                                                                        ListAdapter departureadapter = new SimpleAdapter(HomeActivity.this,flightList,
                                                                                R.layout.list,
                                                                                new String[] { TAG_MDESTINATION, TAG_MFLIGHT, TAG_MAIRLINE,TAG_MSCHEDULE,TAG_MTERMINALGATE,TAG_MFSTATUS  }, new int[] {
                                                                                        R.id.textdestination, R.id.textflight, R.id.textairline,R.id.textschedule,R.id.texttermgate,R.id.textstatus });
                                                                        setListAdapter(departureadapter);

                                                                  }
                                            } // for interval
                                    }
                                    else
                                    {   
                                        //Log.e("departure before chek List", "chek-->"+cheklist);
                                                cheklist=0;
                                        //Log.e("departure after List", "chek-->"+cheklist);        
                                                if(!arrivalList.isEmpty())
                                                {
                                                                Log.e("listhandler arrival","work");
                                                                    int displaymode=getResources().getConfiguration().orientation;
                                                                    if(displaymode==1)
                                                                    {
                                                                        text1.setText("Origin");
                                                                        text4.setText("Arrival");
                                                                        textviewinfo.setText("Arrival Flight List");

                                                                            ListAdapter arrivaladapter = new SimpleAdapter(HomeActivity.this,arrivalList,
                                                                                    R.layout.listportrait,
                                                                                    new String[] { TAG_MDESTINATION, TAG_MFLIGHT, TAG_MAIRLINE,TAG_MSCHEDULE,TAG_MTERMINALGATE,TAG_MFSTATUS  }, new int[] {
                                                                                            R.id.textdestination, R.id.textflight, R.id.textairline,R.id.textschedule,R.id.texttermgate,R.id.textstatus });
                                                                            setListAdapter(arrivaladapter);

                                                                    }
                                                                    else
                                                                    {
                                                                            text1.setText("Origin");
                                                                            text4.setText("Arrival");
                                                                            textviewinfo.setText("Arrival Flight List");

                                                                        ListAdapter arrivaladapter = new SimpleAdapter(HomeActivity.this,arrivalList,
                                                                                R.layout.list,
                                                                                new String[] { TAG_MDESTINATION, TAG_MFLIGHT, TAG_MAIRLINE,TAG_MSCHEDULE,TAG_MTERMINALGATE,TAG_MFSTATUS  }, new int[] {
                                                                                        R.id.textdestination, R.id.textflight, R.id.textairline,R.id.textschedule,R.id.texttermgate,R.id.textstatus });
                                                                        setListAdapter(arrivaladapter);

                                                                    }
                                                } 
                                    }

                        }                               
                        else
                        {

                            if(alertDialog.isShowing())
                            {   
                                alertDialog.dismiss();
                            }
                            else
                            {

                                alert();
                            }

                            scrollView.fullScroll(ScrollView.FOCUS_DOWN);

                        }


                        departurehandler.postDelayed(this, 10000);
                    }

                };  departurehandler.postDelayed(runnable, 100);




        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
}
  • 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-06-16T01:12:52+00:00Added an answer on June 16, 2026 at 1:12 am

    The code below is causing your application to force close

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); 
                StrictMode.setThreadPolicy(policy); 
    

    The thing is you are trying to call web service from the main thread which is against the android thread policy.

    So due to this StrictMode.ThreadPolicy will force close your application.

    So please check after commenting the code related to strictmode and then try to run once again.

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

Sidebar

Related Questions

No matter what I start up, Visual VM just gives me Unknown Application and
I've never done a Java Web start application before. I wrote my app's JNLP
I have installed clojure plugins in eclipse so that I can start developing apps
I'm going to start a new project that's building web apps from scratch. I
In my application presently when the user selects Start program automatically in my options,
I want to start learning about creating apps/games on the iPad 2. I cannot
Our team is about to start a SAAS web application geared toward small businesses.
I have a chance to start porting a legacy application written in C++/Powerbuilder to
i use directionFinder in Google Apps Script application and I want do add some
I have an application I'd like to build that starts when you start the

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.