long1eu / long1eu/SpaceTabLayout
How to send data from Activity to Fragment?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 265
- PR merge metrics
- No merged PRs in 30d
Description
MyActivity onCreate
```
Bundle bundle=new Bundle();
bundle.putString("name", "From Activity");
bundle.putInt("id", 4);
FragmentA fragobjA = new FragmentA();
fragobjA.setArguments(bundle);
```
and this FragmentA
```
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_a, container, false);
Bundle bundle = this.getArguments();
if (bundle != null) {
nomor = bundle.getInt("id", 0);
info= bundle.getString("name");
};
return rootView;
} .....
```
error nomor and id value : null
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing MyActivity's onCreate flow and the FragmentA lifecycle, especially where FragmentA is attached after its arguments are set. Reproduce the null values and verify the argument values are available in FragmentA before considering the issue resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100