引数追加

This commit is contained in:
r-ca 2024-01-20 17:25:44 +09:00
parent 76734de987
commit 028ca6303a
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -15,13 +15,18 @@ import android.view.ViewGroup;
*/ */
public class ComponentViewerTopFragment extends Fragment { public class ComponentViewerTopFragment extends Fragment {
private static final String TAG = "ComponentViewerTopFragment";
private String documentId;
public ComponentViewerTopFragment() { public ComponentViewerTopFragment() {
// Required empty public constructor // Required empty public constructor
} }
public static ComponentViewerTopFragment newInstance() { public static ComponentViewerTopFragment newInstance(String documentId) {
ComponentViewerTopFragment fragment = new ComponentViewerTopFragment(); ComponentViewerTopFragment fragment = new ComponentViewerTopFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("documentId", documentId);
fragment.setArguments(args); fragment.setArguments(args);
return fragment; return fragment;
} }
@ -29,6 +34,9 @@ public class ComponentViewerTopFragment extends Fragment {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (getArguments() != null) {
documentId = getArguments().getString("documentId");
}
} }
@Override @Override