传递一个字符串从一个活动到另一个活动在AndroidStudio



这是一个Java新手,所以我不确定这个问题是否合适。我将尽可能简单地描述我的问题。

我从事一个有各种活动和方法的项目。我的目的只是让传递来自一个Activity (MultiboxTracker)的一个局部变量(String)——包含所需变量的那个)到另一个(CameraActivity)——想传递变量的那个)。

MultiboxTracker的结构:

public class MultiBoxTracker extends AppCompatActivity {
...
public synchronized void draw(final Canvas canvas) {
...
(Here is the wanted String variable!)
}
}

CameraActivity的结构:

public abstract class CameraActivity<labelID, title> extends AppCompatActivity
implements OnImageAvailableListener, CompoundButton.OnCheckedChangeListener,
View.OnClickListener {
...
public void browser(View view) {
Intent i = getIntent();
Bundle bundle = i.getExtras();
String test = bundle.getString("Pass the String");

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com/" + test));
startActivity(browserIntent);
}
}

CameraActivity我已经创建了一个方法浏览器当您按下按钮时打开一个链接。因此,我想要的是使用来自MultiboxTracker Activity的字符串,以便在我按按钮时搜索此特定主题。我已经找到了如何传递字符串的各种相关线程,但我再次无法实现这一点。我很确定我做错了什么,但我不明白在哪里,甚至是错误的合理性。

这是我最后一次使用Intent:

通过

String test = "White";
Intent i = new Intent(this, CameraActivity.class);
i.putExtra("Pass the String", test);
startActivity(i);

提取
Intent i = getIntent();
Bundle bundle = i.getExtras();
String test = bundle.getString("Pass the String");

// This attempt returns a null value.

编辑:我正在添加我的Logcat。在这个阶段,应用程序执行对象检测(预测),然后依次按下创建的按钮来搜索此预测。W/TFLiteObjectDetectionAPIModelWithInterpreter: Aghios Demetrius, Saint Apostoles等;我的类通过扩展字符串我想传递。

2021-03-12 12:01:22.906 22826-22841/org.tensorflow.lite.examples.detection W/System: A resource failed to call release. 
2021-03-12 12:01:24.796 22826-22826/org.tensorflow.lite.examples.detection D/tensorflow: CameraActivity: onStart org.tensorflow.lite.examples.detection.DetectorActivity@27a7313
2021-03-12 12:01:24.798 22826-22826/org.tensorflow.lite.examples.detection D/tensorflow: CameraActivity: onResume org.tensorflow.lite.examples.detection.DetectorActivity@27a7313
2021-03-12 12:01:24.821 22826-22826/org.tensorflow.lite.examples.detection D/CameraMetadataJV: setAppNameAndSensorId org.tensorflow.lite.examples.detection, sensorId:0
2021-03-12 12:01:24.821 22826-22826/org.tensorflow.lite.examples.detection D/CameraMetadataJV: setAppNameAndSensorId mIsXiaomCam:false
2021-03-12 12:01:24.824 22826-22826/org.tensorflow.lite.examples.detection D/CameraMetadataJV: MiAddResolution: 9248x6936, format:33, input:false
2021-03-12 12:01:24.824 22826-22826/org.tensorflow.lite.examples.detection D/CameraMetadataJV: MiAddResolution: 9280x6944, format:32, input:false
2021-03-12 12:01:24.831 22826-22826/org.tensorflow.lite.examples.detection I/tensorflow: CameraConnectionFragment: Desired size: 640x480, min size: 480x480
2021-03-12 12:01:24.832 22826-22826/org.tensorflow.lite.examples.detection I/tensorflow: CameraConnectionFragment: Valid preview sizes: [4640x3472, 4624x3472, 4624x2600, 4624x2136, 3840x2160, 3472x3472, 2560x1920, 1920x1440, 2340x1080, 1920x1080, 1440x1080, 1080x1080, 1440x720, 1280x720, 960x720, 720x480, 640x480]
2021-03-12 12:01:24.832 22826-22826/org.tensorflow.lite.examples.detection I/tensorflow: CameraConnectionFragment: Rejected preview sizes: [352x288, 320x240, 176x144]
2021-03-12 12:01:24.832 22826-22826/org.tensorflow.lite.examples.detection I/tensorflow: CameraConnectionFragment: Exact size match found.
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Aghios Demetrius
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Saint Apostoles
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Saint Sophia
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Acheiropoietos
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Saint Aikaterini
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Panayia Chalkeon
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Saint Nikolaos Orphanos
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Saint Panteleimon
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Metamorphosis Sotiros
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Profitis Elias
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Osios David
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Vlatadon Monastery
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: White Tower
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Byzantine Baths
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: The Walls
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Trigonion Tower
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Heptapyrgion
2021-03-12 12:01:24.842 22826-22826/org.tensorflow.lite.examples.detection W/TFLiteObjectDetectionAPIModelWithInterpreter: Rotunda
2021-03-12 12:01:24.931 22826-22826/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Camera orientation relative to screen canvas: 90
2021-03-12 12:01:24.931 22826-22826/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Initializing at size 640x480
2021-03-12 12:01:24.935 22826-22826/org.tensorflow.lite.examples.detection D/CameraMetadataJV: setAppNameAndSensorId org.tensorflow.lite.examples.detection, sensorId:0
2021-03-12 12:01:24.935 22826-22826/org.tensorflow.lite.examples.detection D/CameraMetadataJV: setAppNameAndSensorId mIsXiaomCam:false
2021-03-12 12:01:24.940 22826-22845/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:24.941 22826-22845/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:24.947 22826-22845/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:24.947 22826-22845/org.tensorflow.lite.examples.detection W/CameraManagerGlobal: ignore the torch status update of camera: 21
2021-03-12 12:01:24.947 22826-22845/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:24.947 22826-22845/org.tensorflow.lite.examples.detection W/CameraManagerGlobal: ignore the torch status update of camera: 22
2021-03-12 12:01:24.947 22826-22845/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:24.947 22826-22845/org.tensorflow.lite.examples.detection W/CameraManagerGlobal: ignore the torch status update of camera: 61
2021-03-12 12:01:24.949 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueConsumer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:-1,c:22826) setDefaultBufferSize: width=640 height=480
2021-03-12 12:01:24.950 22826-22826/org.tensorflow.lite.examples.detection V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@9db936c, this = DecorView@af0dd35[DetectorActivity]
2021-03-12 12:01:24.950 22826-26198/org.tensorflow.lite.examples.detection E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-03-12 12:01:24.952 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: CameraConnectionFragment: Opening camera preview: 640x480
2021-03-12 12:01:24.953 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueue: [unnamed-22826-7](this:0x7cf0d22000,id:7,api:0,p:-1,c:-1) BufferQueue core=(22826:org.tensorflow.lite.examples.detection)
2021-03-12 12:01:24.953 22826-26198/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "vendor.debug.bq.dump"
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueConsumer: [unnamed-22826-7](this:0x7cf0d22000,id:7,api:0,p:-1,c:22826) connect(C): consumer=(22826:org.tensorflow.lite.examples.detection) controlledByApp=true
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "vendor.debug.bq.dump"
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueConsumer: [unnamed-22826-7](this:0x7cf0d22000,id:7,api:0,p:-1,c:22826) setConsumerName: unnamed-22826-7
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "vendor.debug.bq.dump"
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueConsumer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:0,p:-1,c:22826) setConsumerName: ImageReader-640x480f23m2-22826-6
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueConsumer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:0,p:-1,c:22826) setDefaultBufferSize: width=640 height=480
2021-03-12 12:01:24.954 22826-26198/org.tensorflow.lite.examples.detection E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-03-12 12:01:24.965 22826-22826/org.tensorflow.lite.examples.detection E/GraphicExt: GraphicExtModuleLoader::CreateGraphicExtInstance false
2021-03-12 12:01:24.966 22826-22858/org.tensorflow.lite.examples.detection D/Surface: Surface::connect(this=0x7cf098b000,api=1)
2021-03-12 12:01:24.968 22826-22858/org.tensorflow.lite.examples.detection D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2021-03-12 12:01:24.968 22826-22858/org.tensorflow.lite.examples.detection D/Surface: Surface::setBufferCount(this=0x7cf098b000,bufferCount=3)
2021-03-12 12:01:24.969 22826-22858/org.tensorflow.lite.examples.detection D/Surface: Surface::allocateBuffers(this=0x7cf098b000)
2021-03-12 12:01:24.969 22826-22826/org.tensorflow.lite.examples.detection D/TextureView: getHardwareLayer, createNewSurface:false
2021-03-12 12:01:24.969 22826-22826/org.tensorflow.lite.examples.detection D/OpenGLRenderer: 0x7cf0ac7b60 setSurfaceTexture: 0x0 to 0x7d01287c00
2021-03-12 12:01:25.053 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) connect(P): api=4 producer=(727:???) producerControlledByApp=true
2021-03-12 12:01:25.057 22826-26198/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) connect(P): api=4 producer=(727:???) producerControlledByApp=false
2021-03-12 12:01:25.337 22826-22845/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) queueBuffer: fps=0.52 dur=7730.43 max=7629.95 min=27.73
2021-03-12 12:01:25.338 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1061 for detection in bg thread.
2021-03-12 12:01:25.349 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1061
2021-03-12 12:01:25.376 22826-22858/org.tensorflow.lite.examples.detection W/BufferQueueDump: [SurfaceTexture-0-22826-0] [addBuffer] slot(1) acquired, seems to be abnormal, just update ...
2021-03-12 12:01:25.430 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 0 results from 1061
2021-03-12 12:01:25.444 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1064 for detection in bg thread.
2021-03-12 12:01:25.459 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1064
2021-03-12 12:01:25.507 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1064
2021-03-12 12:01:25.535 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1067 for detection in bg thread.
2021-03-12 12:01:25.541 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1067
2021-03-12 12:01:25.587 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 0 results from 1067
2021-03-12 12:01:25.608 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1069 for detection in bg thread.
2021-03-12 12:01:25.618 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1069
2021-03-12 12:01:25.665 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1069
2021-03-12 12:01:25.675 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1071 for detection in bg thread.
2021-03-12 12:01:25.687 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1071
2021-03-12 12:01:25.740 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1071
2021-03-12 12:01:25.745 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1073 for detection in bg thread.
2021-03-12 12:01:25.752 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1073
2021-03-12 12:01:25.798 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1073
2021-03-12 12:01:25.812 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1075 for detection in bg thread.
2021-03-12 12:01:25.827 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1075
2021-03-12 12:01:25.870 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1075
2021-03-12 12:01:25.877 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1077 for detection in bg thread.
2021-03-12 12:01:25.883 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1077
2021-03-12 12:01:25.930 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1077
2021-03-12 12:01:25.944 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1079 for detection in bg thread.
2021-03-12 12:01:25.957 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1079
2021-03-12 12:01:26.019 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1079
2021-03-12 12:01:26.045 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1081 for detection in bg thread.
2021-03-12 12:01:26.060 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1081
2021-03-12 12:01:26.115 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1081
2021-03-12 12:01:26.150 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1084 for detection in bg thread.
2021-03-12 12:01:26.163 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1084
2021-03-12 12:01:26.235 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 0 results from 1084
2021-03-12 12:01:26.252 22826-26198/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Preparing image 1087 for detection in bg thread.
2021-03-12 12:01:26.261 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: DetectorActivity: Running detection on image 1087
2021-03-12 12:01:26.280 22826-22826/org.tensorflow.lite.examples.detection I/Timeline: Timeline: Activity_launch_request time:145059470
2021-03-12 12:01:26.350 22826-22843/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) queueBuffer: slot 5 is dropped, handle=0x7cf0983580
2021-03-12 12:01:26.350 22826-22843/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) queueBuffer: fps=28.62 dur=1013.37 max=53.09 min=17.38
2021-03-12 12:01:26.350 22826-22843/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) queueBuffer: fps=28.63 dur=1013.03 max=52.96 min=18.32
2021-03-12 12:01:26.354 22826-26197/org.tensorflow.lite.examples.detection I/tensorflow: MultiBoxTracker: Processing 1 results from 1087
2021-03-12 12:01:26.379 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) cancelBuffer: slot 7
2021-03-12 12:01:26.379 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) cancelBuffer: slot 6
2021-03-12 12:01:26.384 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) cancelBuffer: slot 0
2021-03-12 12:01:26.384 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) cancelBuffer: slot 0
2021-03-12 12:01:26.385 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) cancelBuffer: slot 1
2021-03-12 12:01:26.385 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) cancelBuffer: slot 1
2021-03-12 12:01:26.386 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) cancelBuffer: slot 2
2021-03-12 12:01:26.386 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) cancelBuffer: slot 2
2021-03-12 12:01:26.386 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) cancelBuffer: slot 3
2021-03-12 12:01:26.386 22826-22843/org.tensorflow.lite.examples.detection D/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) cancelBuffer: slot 3
2021-03-12 12:01:26.392 22826-22841/org.tensorflow.lite.examples.detection W/System: A resource failed to call close. 
2021-03-12 12:01:26.468 22826-22843/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:26.469 22826-22826/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [SurfaceTexture-0-22826-0](this:0x7d01237800,id:0,api:4,p:727,c:22826) disconnect(P): api 4
2021-03-12 12:01:26.469 22826-22843/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:26.469 22826-22843/org.tensorflow.lite.examples.detection W/CameraManagerGlobal: ignore the torch status update of camera: 21
2021-03-12 12:01:26.469 22826-22826/org.tensorflow.lite.examples.detection I/BufferQueueProducer: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:727,c:22826) disconnect(P): api 4
2021-03-12 12:01:26.469 22826-22843/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:26.470 22826-22843/org.tensorflow.lite.examples.detection W/CameraManagerGlobal: ignore the torch status update of camera: 22
2021-03-12 12:01:26.470 22826-22843/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:26.470 22826-22843/org.tensorflow.lite.examples.detection W/CameraManagerGlobal: ignore the torch status update of camera: 61
2021-03-12 12:01:26.473 22826-22843/org.tensorflow.lite.examples.detection E/libc: Access denied finding property "camera.aux.packagelist"
2021-03-12 12:01:26.474 22826-22826/org.tensorflow.lite.examples.detection D/tensorflow: CameraActivity: onPause org.tensorflow.lite.examples.detection.DetectorActivity@27a7313
2021-03-12 12:01:26.880 22826-22858/org.tensorflow.lite.examples.detection D/Surface: Surface::disconnect(this=0x7cf098b000,api=1)
2021-03-12 12:01:26.891 22826-22858/org.tensorflow.lite.examples.detection I/GED: ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 27, oppidx_max 27, oppidx_min 0
2021-03-12 12:01:26.893 22826-22826/org.tensorflow.lite.examples.detection D/tensorflow: CameraActivity: onStop org.tensorflow.lite.examples.detection.DetectorActivity@27a7313
2021-03-12 12:01:26.900 22826-22826/org.tensorflow.lite.examples.detection V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent = android.view.ViewRootImpl@9db936c, this = DecorView@af0dd35[DetectorActivity]
2021-03-12 12:01:32.057 22826-22843/org.tensorflow.lite.examples.detection I/BufferQueue: [ImageReader-640x480f23m2-22826-6](this:0x7cf0d22000,id:7,api:4,p:-1,c:-1) ~BufferQueueCore
2021-03-12 12:01:32.057 22826-22843/org.tensorflow.lite.examples.detection D/RefBase: RefBase: Explicit destruction, weak count = 0 (in 0x7cf0d23458)
2021-03-12 12:01:32.057 22826-22843/org.tensorflow.lite.examples.detection W/RefBase: CallStack::getCurrentInternal not linked, returning null
2021-03-12 12:01:32.057 22826-22843/org.tensorflow.lite.examples.detection W/RefBase: CallStack::logStackInternal not linked
2021-03-12 12:01:32.060 22826-22841/org.tensorflow.lite.examples.detection W/System: A resource failed to call release. 

你可以像这样传递一个字符串

String test = "white";
Intent intent = new Intent(MultiBoxTracker.this, CameraActivity.class);
intent.putExtra("String", test);
startActivity(intent);

然后得到这样的字符串

intent = getIntent();
String string = intent.getStringExtra("String");