0

I have the following code in a Custom Array Adapter where I use a button click event to start another activity. The Array adapter is in a different package and the activity which I want to start is in a different package.

public void onClick(View v) {
            int position = (Integer) v.getTag();
            String savedName = getByIndex(assignments, position).getSavingName();
            Intent markingViewIntent = new Intent("com.it.AssignmentMarkingFragment.intent.action.Launch");
            markingViewIntent.putExtra("assignment", savedName);
            v.getContext().startActivity(markingViewIntent);
        }

Following is my manifest file.

<activity android:name="com.it.AssignmentMarkingFragment">
        <intent-filter>
            <action android:name="com.it.AssignmentMarkingFragment.intent.action.Launch" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

This is how I am getting the data from the other activity inside onCreate().

Bundle extras = getIntent().getExtras();
String name = extras.getString("assignment");

But the value of name is always null. Can anyone figure out what I'm doing wrong here. Thanks in advance!

Lak
  • 381
  • 1
  • 5
  • 23

0 Answers0