Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f0f6563f8a | ||
|
87f05224a4 |
|
@ -33,9 +33,8 @@ dependencies {
|
|||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||
}
|
|
@ -1,13 +1,18 @@
|
|||
package com.example.childguard;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link QRFragment#newInstance} factory method to
|
||||
|
@ -49,11 +54,12 @@ public class QRFragment extends Fragment {
|
|||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
new IntentIntegrator(getActivity()).initiateScan();//QRカメラ起動
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//QRカメラから受け取った引数の処理
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
|
@ -61,4 +67,5 @@ public class QRFragment extends Fragment {
|
|||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_qr, container, false);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user