D/CarrierSvcBindHelper: No carrier app for: 0 2018-11-18 23:35:46.978 1884-1896/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.tyler.trafficapp/.MainActivity} from uid 2000 2018-11-18 23:35:47.132 9231-9231/? I/yler.trafficap: Not late-enabling -Xcheck:jni (already on) 2018-11-18 23:35:47.137 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:47.143 1884-1904/system_process I/ActivityManager: Start proc 9231:com.example.tyler.trafficapp/u0a86 for activity com.example.tyler.trafficapp/.MainActivity 2018-11-18 23:35:47.150 9231-9231/? W/yler.trafficap: Unexpected CPU variant for X86 using defaults: x86 2018-11-18 23:35:47.251 9231-9231/com.example.tyler.trafficapp I/yler.trafficap: The ClassLoaderContext is a special shared library. 2018-11-18 23:35:47.256 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:47.525 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.526 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.528 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.529 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.529 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.530 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.530 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.531 1917-1927/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.576 9231-9231/com.example.tyler.trafficapp W/yler.trafficap: JIT profile information will not be recorded: profile file does not exits. 2018-11-18 23:35:47.581 9231-9231/com.example.tyler.trafficapp I/chatty: uid=10086(com.example.tyler.trafficapp) identical 10 lines 2018-11-18 23:35:47.581 9231-9231/com.example.tyler.trafficapp W/yler.trafficap: JIT profile information will not be recorded: profile file does not exits. 2018-11-18 23:35:47.605 2529-2883/com.google.android.googlequicksearchbox:search D/EGL_emulation: eglMakeCurrent: 0xec405d80: ver 3 0 (tinfo 0xec403cc0) 2018-11-18 23:35:47.606 2545-2716/com.google.android.apps.nexuslauncher D/EGL_emulation: eglMakeCurrent: 0xec405a80: ver 3 0 (tinfo 0xec403930) 2018-11-18 23:35:47.609 1736-1767/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.610 1736-1767/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.611 1736-1767/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.612 1736-1767/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.617 2044-2293/com.android.systemui D/EGL_emulation: eglMakeCurrent: 0xec4058a0: ver 3 0 (tinfo 0xec403570) 2018-11-18 23:35:47.618 1736-1952/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.618 9231-9231/com.example.tyler.trafficapp I/InstantRun: starting instant run server: is main process 2018-11-18 23:35:47.619 1736-1952/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.620 1736-1952/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.621 1736-1952/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:47.828 9231-9231/com.example.tyler.trafficapp W/yler.trafficap: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection) 2018-11-18 23:35:47.829 9231-9231/com.example.tyler.trafficapp W/yler.trafficap: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection) 2018-11-18 23:35:47.870 9231-9231/com.example.tyler.trafficapp D/Android :: The onCreate() event 2018-11-18 23:35:48.362 9231-9231/com.example.tyler.trafficapp D/OpenGLRenderer: Skia GL Pipeline 2018-11-18 23:35:48.372 1736-1767/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property 2018-11-18 23:35:48.411 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:48.417 9231-9255/com.example.tyler.trafficapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 2018-11-18 23:35:48.419 9231-9255/com.example.tyler.trafficapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 2018-11-18 23:35:48.419 9231-9255/com.example.tyler.trafficapp I/OpenGLRenderer: Initialized EGL, version 1.4 2018-11-18 23:35:48.419 9231-9255/com.example.tyler.trafficapp D/OpenGLRenderer: Swap behavior 1 2018-11-18 23:35:48.420 9231-9255/com.example.tyler.trafficapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 2018-11-18 23:35:48.420 9231-9255/com.example.tyler.trafficapp D/OpenGLRenderer: Swap behavior 0 2018-11-18 23:35:48.422 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:48.424 9231-9255/com.example.tyler.trafficapp D/EGL_emulation: eglCreateContext: 0xec4051e0: maj 3 min 0 rcv 3 2018-11-18 23:35:48.437 1604-1671/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:48.465 9231-9255/com.example.tyler.trafficapp D/EGL_emulation: eglMakeCurrent: 0xec4051e0: ver 3 0 (tinfo 0xec4036e0) 2018-11-18 23:35:48.468 1736-2021/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property 2018-11-18 23:35:48.524 2026-com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.tyler.trafficapp/com.example.tyler.trafficapp.JsonActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2005) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673) at android.app.Activity.startActivityForResult(Activity.java:4586) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767) at android.app.Activity.startActivityForResult(Activity.java:4544) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754) at android.app.Activity.startActivity(Activity.java:4905) at android.app.Activity.startActivity(Activity.java:4873) at com.example.tyler.trafficapp.MainActivity.viewJSON(MainActivity.java:141) at java.lang.reflect.Method.invoke(Native Method) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) at android.view.View.performClick(View.java:6597) at android.view.View.performClickInternal(View.java:6574) at android.view.View.access$3100(View.java:778) at android.view.View$PerformClick.run(View.java:25885) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 2018-11-18 23:35:53.452 1594-3761/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 2722578 , only wrote 2722320 2018-11-18 23:35:53.452 1884-1896/system_process W/ActivityManager: Force finishing activity com.example.tyler.trafficapp/.MainActivity 2018-11-18 23:35:53.475 9231-9231/com.example.tyler.trafficapp I/Process: Sending signal. PID: 9231 SIG: 9 2018-11-18 23:35:53.525 1884-1984/system_process W/InputDispatcher: channel '724706b com.example.tyler.trafficapp/com.example.tyler.trafficapp.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 2018-11-18 23:35:53.525 1884-1984/system_process E/InputDispatcher: channel '724706b com.example.tyler.trafficapp/com.example.tyler.trafficapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 2018-11-18 23:35:53.527 1737-1737/? I/Zygote: Process 9231 exited due to signal (9) 2018-11-18 23:35:53.532 1884-3588/system_process I/WindowManager: WIN DEATH: Window{724706b u0 com.example.tyler.trafficapp/com.example.tyler.trafficapp.MainActivity} 2018-11-18 23:35:53.532 1884-3588/system_process W/InputDispatcher: Attempted to unregister already unregistered input channel '724706b com.example.tyler.trafficapp/com.example.tyler.trafficapp.MainActivity (server)' 2018-11-18 23:35:53.534 1884-2511/system_process I/ActivityManager: Process com.example.tyler.trafficapp (pid 9231) has died: vis +99TOP 2018-11-18 23:35:53.535 1884-1905/system_process W/libprocessgroup: kill(-9231, 9) failed: No such process 2018-11-18 23:35:53.535 1884-1905/system_process I/libprocessgroup: Successfully killed process cgroup uid 10086 pid 9231 in 0ms 2018-11-18 23:35:53.540 1736-1952/? W/SurfaceFlinger: Attempting to set client state on removed layer: com.example.tyler.trafficapp/com.example.tyler.trafficapp.MainActivity#0 2018-11-18 23:35:53.540 1736-1952/? W/SurfaceFlinger: Attempting to destroy on removed layer: com.example.tyler.trafficapp/com.example.tyler.trafficapp.MainActivity#0 2018-11-18 23:35:53.555 1884-1910/system_process W/ActivityManager: setHasOverlayUi called on unknown pid: 9231 2018-11-18 23:35:53.557 1917-1926/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:53.558 1917-1926/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:53.558 1917-1926/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling 2018-11-18 23:35:53.560 1917-1926/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:53.576 1604-1671/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.597 1604-1671/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.607 1594-3761/? W/audio_hw_generic: Hardware backing HAL too slow, could only write 0 of 720 frames 2018-11-18 23:35:53.608 1736-1736/? D/SurfaceFlinger: duplicate layer name: changing com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity to com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity#1 2018-11-18 23:35:53.609 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.612 1604-1671/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.627 1604-1671/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.628 2529-2529/com.google.android.googlequicksearchbox:search I/MemoryTrimmer: Trimming objects from memory, since app is in the background. 2018-11-18 23:35:53.637 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.649 1736-2021/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:53.651 1736-2021/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:53.652 1736-2021/? D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread) 2018-11-18 23:35:53.653 1736-2021/? D/gralloc_ranchu: 2018-11-18 23:35:53.722 2529-2883/com.google.android.googlequicksearchbox:search D/EGL_emulation: eglMakeCurrent: 0xec405e40: ver 3 0 (tinfo 0xec403cc0) 2018-11-18 23:35:53.723 2044-2293/com.android.systemui D/EGL_emulation: eglMakeCurrent: 0xec4058a0: ver 3 0 (tinfo 0xec403570) 2018-11-18 23:35:53.731 2044-2293/com.android.systemui D/EGL_emulation: eglMakeCurrent: 0xec4058a0: ver 3 0 (tinfo 0xec403570) 2018-11-18 23:35:53.739 1604-1672/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 14749696 2018-11-18 23:35:53.788 2529-2883/com.google.android.googlequicksearchbox:search D/EGL_emulation: eglMakeCurrent: 0xec405e40: ver 3 0 (tinfo 0xec403cc0) 2018-11-18 23:35:53.797 2529-2529/com.google.android.googlequicksearchbox:search W/SessionLifecycleManager: Handover failed. Creating new session controller. ryBuilder
2018-11-18 23:35:54.025 2529-8706/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_close SR : 16000 CC : 16 SO : 6
2018-11-18 23:35:54.027 2529-8145/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Detection finished
2018-11-18 23:35:54.030 2529-8145/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
2018-11-18 23:35:54.031 2529-3074/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Stopping hotword detection.
2018-11-18 23:35:54.031 2529-8145/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.microdetection.d.k.a(SourceFile:91)
at com.google.android.apps.gsa.staticplugins.microdetection.d.l.run(Unknown Source:14)
at com.google.android.libraries.gsa.runner.a.a.b(SourceFile:32)
at com.google.android.libraries.gsa.runner.a.c.call(Unknown Source:4)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
2018-11-18 23:35:54.226 1884-1901/system_process I/GnssLocationProvider: WakeLock released by handleMessage(SET_REQUEST, 0, com.android.server.location.GnssLocationProvider$GpsRequest@c1a6cf7)
2018-11-18 23:35:54.257 1884-4563/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(SET_REQUEST, 0, com.android.server.location.GnssLocationProvider$GpsRequest@27dd764)
2018-11-18 23:35:54.258 1884-1901/system_process I/GnssLocationProvider: WakeLock released by handleMessage(SET_REQUEST, 0, com.android.server.location.GnssLocationProvider$GpsRequest@27dd764)
2018-11-18 23:35:54.268 1884-2342/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(SET_REQUEST, 0, com.android.server.location.GnssLocationProvider$GpsRequest@28d5dcd)
2018-11-18 23:35:54.271 1884-1901/system_process I/GnssLocationProvider: WakeLock released by handleMessage(SET_REQUEST, 0, com.android.server.location.GnssLocationProvider$GpsRequest@28d5dcd)
the app crashes whenever I press the button, which is just trying to parse a JSON file saved in res/raw/activity_json.json
I tried making the JSON very short thinking I had an overflow but no luck, anybody can help?
I currently have other buttns in my main that are working fine, just this one where i am trying to parse a JSON file crashes everytime i touvh it. Thank You
In my main activity
public void viewJSON(View view) {
Intent JSONView = new Intent(this, JsonActivity.class);
startActivity(JSONView);
}
In string.xml
<
string name = "List_View_JSON" > Camera list json < /string>
In the java Activity
package com.example.tyler.trafficapp;
import android.os.Bundle;
import android.service.autofill.TextValueSanitizer;
import android.support.v7.app.AppCompatActivity;
import android.content.res.Resources;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;
import java.io.InputStream;
import java.util.Scanner;
public class JsonActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_json);
}
public void loadCamera() {
Resources res = getResources();
InputStream is = res.openRawResource(R.raw.activity_json);
StringBuilder builder = new StringBuilder();
Scanner scanner = new Scanner(is);
while (scanner.hasNext()) {
builder.append(scanner.nextLine());
}
parseJSON(builder.toString());
}
private void parseJSON(String s) {
TextView view = (TextView) findViewById(R.id.recyclerCam2);
view.setText(s);
}
}
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"><android.support.v7.widget.RecyclerView android:id="@+id/recyclerCam2" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"/></RelativeLayout>In the xml layout <Button android:id="@+id/button3" style="@style/Widget.AppCompat.Button.Colored" android:layout_width="247dp" android:layout_height="77dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:onClick="viewJSON" android:stateListAnimator="@mipmap/ic_launcher_round" android:text="@string/List_View_JSON" />
package com.example.tyler.trafficapp; import android.os.Bundle; import android.service.autofill.TextValueSanitizer; import android.support.v7.app.AppCompatActivity; import android.content.res.Resources; import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView; import android.widget.TextView; import java.io.InputStream; import java.util.Scanner; public class JsonActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_json); } public void loadCamera() { Resources res = getResources(); InputStream is = res.openRawResource(R.raw.activity_json); StringBuilder builder = new StringBuilder(); Scanner scanner = new Scanner(is); while (scanner.hasNext()){
builder.append(scanner.nextLine()); } parseJSON(builder.toString()); } private void parseJSON(String s) { TextView view = (TextView) findViewById(R.id.recyclerCam2); view.setText(s); } }
User contributions licensed under CC BY-SA 3.0