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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:34:24+00:00 2026-05-25T11:34:24+00:00

KitActivity: /** in KitActivity, handler invoked after successful transmission **/ private final Handler txHandle

  • 0

KitActivity:

/** in KitActivity, handler invoked after successful transmission **/
private final Handler txHandle = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        boolean success = msg.getData().getBoolean("success");
        dismissDialog(DIALOG_TX_PROGRESS);
        if(success) {
            SharedPreferences.Editor editor = mPrefs.edit();
            editor.putInt("previous_scale", mScaleSpn.getSelectedItemPosition());
            editor.commit();
            //clearFields();
            //showDialog(DIALOG_ETX);
            KitActivity.this.setResult(0);
            KitActivity.this.finish();
        } else {
            removeDialog(DIALOG_FAIL);
            showDialog(DIALOG_FAIL);
        }

    }
};

MainActivity:

/** in the MainActivity **/
public void startCreateKit() {
    Intent i = new Intent(MainActivity.this, KitActivity.class);
    startActivityForResult(i,0);
}

protected void onActivityResult(int reqCode, int resCode) {
    if(reqCode==0) {
        if(resCode==0) {
            //we good, perform sync
            showDialog(DIALOG_TX_PROGRESS);
            Toast.makeText(this, "Performing Auto Sync", Toast.LENGTH_LONG).show();
            updateKits();
        } else {
            //uh oh
        }
    }
}

createKitBtn.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            //Toast.makeText(context, "NEW KIT", Toast.LENGTH_SHORT).show();
            startCreateKit();
        }
    });

onActivityResult is never called in MainActivity. this is pretty much by the book. what’s the issue?

stuff i’ve tried:
– using Activity.RESULT_OK for the result code (which translates to -1);
– removing the setResult() and finish() calls from the handler and calling an outside method to invoke them.

i don’t see anything wrong. here’s the manifest, nothing awry here:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.conceptualsystems.kitmobile"
      android:versionCode="8"
      android:versionName="@string/version">
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true">
        <activity android:name="MainActivity"
                  android:label="@string/app_name"
                  android:screenOrientation="portrait"
                  android:configChanges="keyboardHidden|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="ShipActivity"
                  android:label="Ship Kits"
                  android:screenOrientation="portrait"
                  android:configChanges="keyboardHidden|orientation">
        </activity>
        <activity android:name="KitActivity"
                  android:label="Kit Entry"
                  android:screenOrientation="portrait"
                  android:configChanges="keyboardHidden|orientation">
        </activity>
        <activity android:name="ColorActivity"
                  android:label="Color Selection"
                  android:screenOrientation="portrait"
                  android:configChanges="keyboardHidden|orientation">
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="8" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest> 

what gives?

  • 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-25T11:34:24+00:00Added an answer on May 25, 2026 at 11:34 am

    replaced:

    protected void onActivityResult(int reqCode, int resCode)
    

    with:

    protected void onActivityResult(int reqCode, int resCode, Intent intent)
    

    amazing what happens when you review the documentation… -_-

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

Sidebar

Related Questions

I am getting the following message when calling RingTonePreference on Samsung Galaxy (everything works
In my iphone application an activity indicator is shown at the time of webservice
I'm currently developing a small test project with Android and I get the infamous

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.