Click here to Skip to main content
15,881,172 members
Home / Discussions / Android
   

Android

 
QuestionOnkeyDown Event in Xamarin Forms Pin
Srinivas Soodula31-May-16 2:06
Srinivas Soodula31-May-16 2:06 
QuestionGet error when passing data using Intent Pin
tan87325-May-16 21:15
tan87325-May-16 21:15 
SuggestionRe: Get error when passing data using Intent Pin
Richard Deeming26-May-16 2:08
mveRichard Deeming26-May-16 2:08 
QuestionRe: Get error when passing data using Intent Pin
David Crow26-May-16 4:29
David Crow26-May-16 4:29 
QuestionSharing...not sure what it is called Pin
Mike885522-Apr-16 5:11
Mike885522-Apr-16 5:11 
AnswerRe: Sharing...not sure what it is called Pin
David Crow22-Apr-16 18:20
David Crow22-Apr-16 18:20 
GeneralRe: Sharing...not sure what it is called Pin
Mike885523-Apr-16 19:22
Mike885523-Apr-16 19:22 
GeneralRe: Sharing...not sure what it is called Pin
Mike885523-Apr-16 22:21
Mike885523-Apr-16 22:21 
Next major roadblock....

I created a class within MainActivity to handle the intent. It just crashes when clicking the app on the share list. All this has to do is populate a string variable and MainActivity will see it in a background task.

The error:
Java
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.remoteapp.manderson.jboxcontroller/com.remoteapp.manderson.jboxcontroller.MainActivity$NextActivity}: java.lang.InstantiationException: java.lang.Class<com.remoteapp.manderson.jboxcontroller.MainActivity$NextActivity> has no zero argument constructor
                                                                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
                                                                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                            at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                            at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                            at android.os.Looper.loop(Looper.java:148)
                                                                                            at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                                         Caused by: java.lang.InstantiationException: java.lang.Class<com.remoteapp.manderson.jboxcontroller.MainActivity$NextActivity> has no zero argument constructor


Manifest:

XML
<activity
            android:name=".SplashActivity"
            android:label="@string/app_name"
            android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
          <activity android:name=".MainActivity">
        </activity>
        <activity android:name=".MainActivity$NextActivity" >
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
                <action android:name="android.intent.action.SEND" />
                <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>


MainActivity class heading:

Java
public class MainActivity extends AppCompatActivity implements View.OnClickListener {



Sub class:

Java
public class NextActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            Intent receivedIntent = getIntent();
            String receivedText = receivedIntent.getStringExtra(Intent.EXTRA_TEXT);
            if (receivedText != null){
                MainActivity.this.playURL =receivedText;
        }
    }



In my first try in a separate activity:

Java
public class ActivityFromExt extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent receivedIntent = getIntent();
        String receivedText = receivedIntent.getStringExtra(Intent.EXTRA_TEXT);
        if (receivedText != null) {
            Intent i = new Intent(getApplicationContext(), MainActivity.NextActivity.class);
            i.putExtra("URL", receivedText);
            startActivity(i);
        }
    }
}


This would crash at startActivity.

Thanks
SuggestionRe: Sharing...not sure what it is called Pin
David Crow24-Apr-16 16:19
David Crow24-Apr-16 16:19 
GeneralRe: Sharing...not sure what it is called Pin
Mike885524-Apr-16 17:51
Mike885524-Apr-16 17:51 
QuestionRegarding android app Pin
Member 1247467320-Apr-16 18:32
Member 1247467320-Apr-16 18:32 
AnswerRe: Regarding android app Pin
Richard MacCutchan20-Apr-16 21:18
mveRichard MacCutchan20-Apr-16 21:18 
AnswerRe: Regarding android app Pin
David Crow21-Apr-16 3:43
David Crow21-Apr-16 3:43 
AnswerRe: Regarding android app Pin
bee__bee22-Apr-16 0:29
bee__bee22-Apr-16 0:29 
QuestionWhy "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Member 1247457620-Apr-16 17:57
Member 1247457620-Apr-16 17:57 
QuestionRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Richard MacCutchan20-Apr-16 21:16
mveRichard MacCutchan20-Apr-16 21:16 
AnswerRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Member 1247457620-Apr-16 22:22
Member 1247457620-Apr-16 22:22 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Richard MacCutchan20-Apr-16 22:33
mveRichard MacCutchan20-Apr-16 22:33 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
luisvaldez27-Jan-17 2:19
luisvaldez27-Jan-17 2:19 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Richard MacCutchan27-Jan-17 3:42
mveRichard MacCutchan27-Jan-17 3:42 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
luisvaldez27-Jan-17 4:58
luisvaldez27-Jan-17 4:58 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Richard MacCutchan27-Jan-17 5:04
mveRichard MacCutchan27-Jan-17 5:04 
GeneralRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
luisvaldez27-Jan-17 5:17
luisvaldez27-Jan-17 5:17 
QuestionRe: Why "shell uiautomator dump /sdcard/dump.xml" can't excute on my android app? Pin
Member 1336095214-Aug-17 8:04
Member 1336095214-Aug-17 8:04 
Questionhow to dispay record on screen Pin
Member 1245752113-Apr-16 17:13
Member 1245752113-Apr-16 17:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.