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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:09:39+00:00 2026-05-29T12:09:39+00:00

My app for some reason fails the first time it opens, but then opens

  • 0

My app for some reason fails the first time it opens, but then opens fine the second time I click on it. Are there any common reasons this happens?

Here is the code for the main activity, any information would be greatly appreciated:

package com.chich;

import android.app.Activity;

import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.gsm.SmsManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class chich_activity extends Activity 
{

Button btnSendSMS;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);  

    ComponentName locationReceiver = new ComponentName(this, SmsReceiver.class);
    PackageManager pm = getPackageManager();
    pm.setComponentEnabledSetting(locationReceiver,
            PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);



    btnSendSMS = (Button) findViewById(R.id.btnSendSMS);
    btnSendSMS.setOnClickListener(new OnClickListener() 
    {


        public void onClick(View v) 
        {     
            Intent i = new Intent(chich_activity.this, chich_activity2.class);
            startActivity(i);

    }    
});
    }
}

Manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.chich"
  android:versionCode="1"
  android:versionName="1.0.0">
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
    <activity android:name=".chich_activity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>     

       <activity android:name=".chich_activity2"
              android:label="@string/app_name">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity> 

    <receiver android:name=".SmsReceiver"> 
        <intent-filter android:priority="9999999" >
            <action android:name = "android.provider.Telephony.SMS_RECEIVED" /> 
        </intent-filter> 
    </receiver>

</application>
<uses-permission android:name="android.permission.SEND_SMS">
</uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS">
</uses-permission>
</manifest>
  • 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-29T12:09:42+00:00Added an answer on May 29, 2026 at 12:09 pm

    The answer came in the package manager. Turns out it shuts the application off if you don’t write in the end, PackageManager.DONT_KILL_APP as in:

    ComponentName locationReceiver = new ComponentName(this, SmsReceiver.class);
    PackageManager pm = getPackageManager();
    pm.setComponentEnabledSetting(locationReceiver,
            PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

logging into django admin fails when 'log in' button is pressed first time, but
I am trying to use log4net in a VB.NET app for some unknown reason
For some reason every 3-5 days our web app loses the ability to open
My app is sending users email with the following: https://blah.chacha.com/feedback/##comment-reply-169 But for some reason,
I've got an ASP.NET app that requires Windows Integrated Security. For some reason, I
for some sick reason, my check productIDs[addIndex] = allProductIDs[lastProductFoundIndex + i]; causes my app
I'm trying to push a django app to the production server, but for some
I have a google app engine app that has been running for some time,
What would be some compelling reasons to upgrade a web app from .NET 1.1
My app some times crashes at start-up. In stack-trace only messages from built-in frameworks.

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.