Hello to all! Today I started learning android
use eclipse already configured (I was able to start a hello world)
Now I would like to launch a webview.
I added in activity_main.xml with the graphic mode, then src / MainActivity.java I wrote:
Code:
package com.example.helloworld;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.text.Editable;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
WebView webview;
[user=439709]@override[/user]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webView = (WebView) findViewById(R.id.webView1);
webView.loadUrl("google");
}
[user=439709]@override[/user]
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
I read it in the emulator:
Code:
unfortunately, HelloWorld has stopped
this is the log:
Code:
09-04 10:19:27.392: D/AndroidRuntime(1728): Shutting down VM
09-04 10:19:27.392: W/dalvikvm(1728): threadid=1: thread exiting with uncaught exception (group=0x41465700)
09-04 10:19:27.411: E/AndroidRuntime(1728): FATAL EXCEPTION: main
09-04 10:19:27.411: E/AndroidRuntime(1728): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.helloworld/com.example.helloworld.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class uses-permission
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.ActivityThread.access$600(ActivityThread.java:141)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.os.Handler.dispatchMessage(Handler.java:99)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.os.Looper.loop(Looper.java:137)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-04 10:19:27.411: E/AndroidRuntime(1728): at java.lang.reflect.Method.invokeNative(Native Method)
09-04 10:19:27.411: E/AndroidRuntime(1728): at java.lang.reflect.Method.invoke(Method.java:525)
09-04 10:19:27.411: E/AndroidRuntime(1728): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-04 10:19:27.411: E/AndroidRuntime(1728): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-04 10:19:27.411: E/AndroidRuntime(1728): at dalvik.system.NativeStart.main(Native Method)
09-04 10:19:27.411: E/AndroidRuntime(1728): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class uses-permission
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
09-04 10:19:27.411: E/AndroidRuntime(1728): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.Activity.setContentView(Activity.java:1895)
09-04 10:19:27.411: E/AndroidRuntime(1728): at com.example.helloworld.MainActivity.onCreate(MainActivity.java:19)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.Activity.performCreate(Activity.java:5133)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
09-04 10:19:27.411: E/AndroidRuntime(1728): ... 11 more
09-04 10:19:27.411: E/AndroidRuntime(1728): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.uses-permission" on path: DexPathList[[zip file "/data/app/com.example.helloworld-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.helloworld-2, /system/lib]]
09-04 10:19:27.411: E/AndroidRuntime(1728): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
09-04 10:19:27.411: E/AndroidRuntime(1728): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
09-04 10:19:27.411: E/AndroidRuntime(1728): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.createView(LayoutInflater.java:559)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:652)
09-04 10:19:27.411: E/AndroidRuntime(1728): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
09-04 10:19:27.411: E/AndroidRuntime(1728): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
09-04 10:19:27.411: E/AndroidRuntime(1728): ... 21 more
09-04 10:19:39.201: I/Process(1728): Sending signal. PID: 1728 SIG: 9
I managed to solve! I put
<uses-permission android:name="android.permission.INTERNET"/>
in activity rather than in the manifest
WebView webview;
and again u written WebView webView = (WebView) findViewById(R.id.webView1);
so 1st one is unused
iacoposk8 said:
I managed to solve! I put
<uses-permission android:name="android.permission.INTERNET"/>
in activity rather than in the manifest
Click to expand...
Click to collapse
permissions go in the manifest. it looks you had yours in the activity?
that's it
that's it
iacoposk8 said:
I managed to solve! I put
<uses-permission android:name="android.permission.INTERNET"/>
in activity rather than in the manifest
Click to expand...
Click to collapse
Related
Hi all,
I've had my Magic since September and for the last few weeks it has intermittently been unresponsive to touch, the screen displays fine but it won't acknowledge any touch. In the last 2 days this has gotten a lot worse and now it barely works at all.
Any attempt to access the Contacts/Dialer throws up a Force close on process com.android.phone
Initially I thought this was a software problem but now I am not so sure. I have reverted back to the stock Vodafone AU rom that I backed up when I initially purchased and am getting ready to send back to HTC but thought I would ask on here as well.
Below is the logcat from a fresh reboot - Quite a few errors I think
Code:
E:\HTC Magic Tools\android-sdk-windows\tools>adb logcat -b main *:W
E/RIL Acoustic( 33): can't open /dev/htc-acoustic -1
E/HTC Acoustic( 35): Fail to open /system/etc/AudioPara_VODA-Australia.csv -1.
E/A2DP ( 35): bt_audio_service_open failed
E/A2dpAudioInterface( 35): a2dp_init failed err: -111
E/AudioFlinger( 35): mA2dpDisableCount is already zero
W/SurfaceFlinger( 58): couldn't grant gpu core to pid 58
E/GLLogger( 58): h/w accelerated eglGetDisplay() failed (EGL_SUCCESS)
W/HAL ( 58): load: module=/system/lib/hw/copybit.sapphire.so error=Cannot
find library
W/HAL ( 58): load: module=/system/lib/hw/copybit.sapphire.so error=Cannot
find library
W/HAL ( 58): load: module=/system/lib/hw/copybit.sapphire.so error=Cannot
find library
W/HAL ( 58): load: module=/system/lib/hw/copybit.sapphire.so error=Cannot
find library
W/HAL ( 58): load: module=/system/lib/hw/overlay.sapphire.so error=Cannot
find library
W/HAL ( 58): load: module=/system/lib/hw/overlay.sapphire.so error=Cannot
find library
W/HAL ( 58): load: module=/system/lib/hw/overlay.msm7k.so error=Cannot fin
d library
W/HAL ( 58): load: module=/system/lib/hw/overlay.default.so error=Cannot f
ind library
W/HAL ( 58): load: module=/system/lib/hw/lights.sapphire.so error=Cannot f
ind library
W/HAL ( 58): load: module=/system/lib/hw/lights.sapphire.so error=Cannot f
ind library
E/lights ( 58): write_int failed to open /sys/class/leds/keyboard-backlight/b
rightness
W/ResourceType( 58): No package identifier when getting value for resource num
ber 0x7f060001
W/ResourceType( 58): No package identifier when getting value for resource num
ber 0x7f030003
W/ResourceType( 58): No package identifier when getting value for resource num
ber 0x7f030000
W/ResourceType( 58): No package identifier when getting value for resource num
ber 0x7f03000c
W/ResourceType( 58): No package identifier when getting value for resource num
ber 0x7f030000
W/ResourceType( 58): No package identifier when getting value for resource num
ber 0x00000000
W/StatusBar( 58): Icon not found in <system>: 0
W/CheckinService( 58): No saved kernel log file
E/ApplicationContext( 58): Couldn't create directory for SharedPreferences fil
e shared_prefs/wallpaper-hints.xml
W/ActivityManager( 58): Unable to start service Intent { action=com.android.us
sd.IExtendedNetworkService }: not found
W/SurfaceFlinger( 58): executeScheduledBroadcasts() skipped, contention on the
client. We'll try again later...
W/AudioFlinger( 35): write blocked for 111 msecs
Thanks in advance for any assistance you can offer me, it would be really appreciated!!
Let me know if you need further info
Some further information
If I try to open Contacts using the trackball the Logcat expands to add the following: -
Code:
W/InputManagerService( 58): Window already focused, ignoring focus gain of: co
[email protected]
W/ResourceType( 95): Failure getting entry for 0x7f030005 (t=2 e=5) in package
0: 0xffffffb5
W/dalvikvm( 95): threadid=3: thread exiting with uncaught exception (group=0x4
000fe70)
E/AndroidRuntime( 95): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 95): java.lang.RuntimeException: Unable to start activity Co
mponentInfo{com.android.contacts/com.android.contacts.DialtactsActivity}: androi
d.content.res.Resources$NotFoundException: Resource ID #0x7f030005
E/AndroidRuntime( 95): at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2268)
E/AndroidRuntime( 95): at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2284)
E/AndroidRuntime( 95): at android.app.ActivityThread.access$1800(Activi
tyThread.java:112)
E/AndroidRuntime( 95): at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1692)
E/AndroidRuntime( 95): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 95): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 95): at android.app.ActivityThread.main(ActivityThrea
d.java:3948)
E/AndroidRuntime( 95): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 95): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 95): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 95): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:540)
E/AndroidRuntime( 95): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 95): Caused by: android.content.res.Resources$NotFoundExcept
ion: Resource ID #0x7f030005
E/AndroidRuntime( 95): at android.content.res.Resources.getValue(Resour
ces.java:846)
E/AndroidRuntime( 95): at android.content.res.Resources.loadXmlResource
Parser(Resources.java:1796)
E/AndroidRuntime( 95): at android.content.res.Resources.getLayout(Resou
rces.java:685)
E/AndroidRuntime( 95): at android.view.LayoutInflater.inflate(LayoutInf
later.java:318)
E/AndroidRuntime( 95): at android.view.LayoutInflater.inflate(LayoutInf
later.java:276)
E/AndroidRuntime( 95): at com.android.internal.policy.impl.PhoneWindow.
setContentView(PhoneWindow.java:309)
E/AndroidRuntime( 95): at android.app.Activity.setContentView(Activity.
java:1626)
E/AndroidRuntime( 95): at com.android.contacts.DialtactsActivity.onCrea
te(DialtactsActivity.java:73)
E/AndroidRuntime( 95): at android.app.Instrumentation.callActivityOnCre
ate(Instrumentation.java:1123)
E/AndroidRuntime( 95): at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2231)
E/AndroidRuntime( 95): ... 11 more
W/ActivityManager( 58): Scheduling restart of crashed service com.google.andro
id.apps.gtalkservice/com.google.android.gtalkservice.service.GTalkService in 500
0ms
W/InputManagerService( 58): Got RemoteException sending setActive(false) notif
ication to pid 95 uid 10004
I'm porting an app from samsung s3 mini to cm10 htc one v
I've deodexed apk and then i'm modding classes.dex to fix problem.
only, i can't open mainactivity i'm getting problem from this smali(MainActivity.smali) and this line.
Landroid/util/GateConfig;->isGateEnabled() -- android.util.GateConfig
Class Def Not Found..
Code:
.line 154
invoke-static {}, Landroid/util/GateConfig;->isGateEnabled()Z
move-result v0
sput-boolean v0, Lcom/sec/android/app/myfiles/MainActivity;->FLAG_SUPPORT_GATE_MESSAGE:Z
return-void
.end method
.method public constructor <init>()V
.registers 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x0
also tried adding util/GateConfig file to out folder but.
when i try run smali.jar for compiling again. i get problems...So, i tried delete half of line 154 smali but now i'm getting
Code:
I/ActivityManager( 1765): Start proc com.sec.android.app.myfiles for activity co
m.sec.android.app.myfiles/.MainActivity: pid=5194 uid=10070 gids={1015, 1023, 30
02}
D/Launcher( 2036): onTrimMemory. Level: 20
E/Trace ( 5194): error opening trace file: No such file or directory (2)
W/dalvikvm( 5194): VFY: register index out of range (2 >= 1)
W/dalvikvm( 5194): VFY: register index out of range (1 >= 1)
W/dalvikvm( 5194): VFY: rejecting opcode 0x5c at 0x000d
W/dalvikvm( 5194): VFY: rejected Lcom/sec/android/app/myfiles/MainActivity;.<cl
init> ()V
W/dalvikvm( 5194): Verifier rejected class Lcom/sec/android/app/myfiles/MainActi
vity;
W/dalvikvm( 5194): Class init failed in newInstance call (Lcom/sec/android/app/m
yfiles/MainActivity;)
D/AndroidRuntime( 5194): Shutting down VM
W/dalvikvm( 5194): threadid=1: thread exiting with uncaught exception (group=0x4
0d83300)
E/AndroidRuntime( 5194): FATAL EXCEPTION: main
E/AndroidRuntime( 5194): java.lang.VerifyError: com/sec/android/app/myfiles/Main
Activity
E/AndroidRuntime( 5194): at java.lang.Class.newInstanceImpl(Native Method
)
E/AndroidRuntime( 5194): at java.lang.Class.newInstance(Class.java:1319)
E/AndroidRuntime( 5194): at android.app.Instrumentation.newActivity(Instr
umentation.java:1053)
E/AndroidRuntime( 5194): at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2090)
E/AndroidRuntime( 5194): at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2210)
E/AndroidRuntime( 5194): at android.app.ActivityThread.access$600(Activit
yThread.java:142)
E/AndroidRuntime( 5194): at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1208)
E/AndroidRuntime( 5194): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 5194): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 5194): at android.app.ActivityThread.main(ActivityThrea
d.java:4931)
E/AndroidRuntime( 5194): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 5194): at java.lang.reflect.Method.invoke(Method.java:5
11)
E/AndroidRuntime( 5194): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 5194): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:558)
E/AndroidRuntime( 5194): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 1765): Force finishing activity com.sec.android.app.myfiles
/.MainActivity
and last one thing.
Code:
C:\Users\Doğa\HTCONEVAllFiles\Data>adb shell
[email protected]:/ # am start com.sec.android.app.myfiles/.MyFilesSettings
When i try open settings activity via adb.it works..
only main activity don't work.
how can i change line 154 without problems???
or how can i add android.util.GateConfig ??
i need fix for that ??
some developer should help me ??? PLEASE
doga.ozkaraca said:
I'm porting an app from samsung s3 mini to cm10 htc one v
I've deodexed apk and then i'm modding classes.dex to fix problem.
only, i can't open mainactivity i'm getting problem from this smali(MainActivity.smali) and this line.
Landroid/util/GateConfig;->isGateEnabled() -- android.util.GateConfig
Class Def Not Found..
Code:
.line 154
invoke-static {}, Landroid/util/GateConfig;->isGateEnabled()Z
move-result v0
sput-boolean v0, Lcom/sec/android/app/myfiles/MainActivity;->FLAG_SUPPORT_GATE_MESSAGE:Z
return-void
.end method
.method public constructor <init>()V
.registers 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x0
also tried adding util/GateConfig file to out folder but.
when i try run smali.jar for compiling again. i get problems...So, i tried delete half of line 154 smali but now i'm getting
Code:
I/ActivityManager( 1765): Start proc com.sec.android.app.myfiles for activity co
m.sec.android.app.myfiles/.MainActivity: pid=5194 uid=10070 gids={1015, 1023, 30
02}
D/Launcher( 2036): onTrimMemory. Level: 20
E/Trace ( 5194): error opening trace file: No such file or directory (2)
W/dalvikvm( 5194): VFY: register index out of range (2 >= 1)
W/dalvikvm( 5194): VFY: register index out of range (1 >= 1)
W/dalvikvm( 5194): VFY: rejecting opcode 0x5c at 0x000d
W/dalvikvm( 5194): VFY: rejected Lcom/sec/android/app/myfiles/MainActivity;.<cl
init> ()V
W/dalvikvm( 5194): Verifier rejected class Lcom/sec/android/app/myfiles/MainActi
vity;
W/dalvikvm( 5194): Class init failed in newInstance call (Lcom/sec/android/app/m
yfiles/MainActivity;)
D/AndroidRuntime( 5194): Shutting down VM
W/dalvikvm( 5194): threadid=1: thread exiting with uncaught exception (group=0x4
0d83300)
E/AndroidRuntime( 5194): FATAL EXCEPTION: main
E/AndroidRuntime( 5194): java.lang.VerifyError: com/sec/android/app/myfiles/Main
Activity
E/AndroidRuntime( 5194): at java.lang.Class.newInstanceImpl(Native Method
)
E/AndroidRuntime( 5194): at java.lang.Class.newInstance(Class.java:1319)
E/AndroidRuntime( 5194): at android.app.Instrumentation.newActivity(Instr
umentation.java:1053)
E/AndroidRuntime( 5194): at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2090)
E/AndroidRuntime( 5194): at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2210)
E/AndroidRuntime( 5194): at android.app.ActivityThread.access$600(Activit
yThread.java:142)
E/AndroidRuntime( 5194): at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1208)
E/AndroidRuntime( 5194): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 5194): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 5194): at android.app.ActivityThread.main(ActivityThrea
d.java:4931)
E/AndroidRuntime( 5194): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 5194): at java.lang.reflect.Method.invoke(Method.java:5
11)
E/AndroidRuntime( 5194): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 5194): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:558)
E/AndroidRuntime( 5194): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 1765): Force finishing activity com.sec.android.app.myfiles
/.MainActivity
and last one thing.
Code:
C:\Users\Doğa\HTCONEVAllFiles\Data>adb shell
[email protected]:/ # am start com.sec.android.app.myfiles/.MyFilesSettings
When i try open settings activity via adb.it works..
only main activity don't work.
how can i change line 154 without problems???
or how can i add android.util.GateConfig ??
i need fix for that ??
some developer should help me ??? PLEASE
Click to expand...
Click to collapse
SOLVED !! THANKS I've SUCCESSFULLY PORTED SAMSUNG GALAXY S3 MİNİ FİLE MANAGER TO CM10/AOKP/AOSP I WİLL RELEASE SOON
I am just taking baby steps in learning Android programming..I am following some tutorials for that and while studying how to implement onKeyListener I am getting an error 'java.lang.RuntimeException: Unable to instantiate activity ComponentInfo java.lang.NullPointerException'. This error is leading to another error 'adt unfortunately app has stopped' while trying to run the app on my phone. Here is the logcat:
05-15 15:55:22.087: D/AndroidRuntime(20672): Shutting down VM
05-15 15:55:22.087: W/dalvikvm(20672): threadid=1: thread exiting with uncaught exception (group=0x41ea1ba8)
05-15 15:55:22.087: E/AndroidRuntime(20672): FATAL EXCEPTION: main
05-15 15:55:22.087: E/AndroidRuntime(20672): Process: com.example.keyboardlistener, PID: 20672
05-15 15:55:22.087: E/AndroidRuntime(20672): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.keyboardlistener/com.example.keyboardlistener.MainActivity}: java.lang.NullPointerException
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.os.Handler.dispatchMessage(Handler.java:102)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.os.Looper.loop(Looper.java:136)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-15 15:55:22.087: E/AndroidRuntime(20672): at java.lang.reflect.Method.invokeNative(Native Method)
05-15 15:55:22.087: E/AndroidRuntime(20672): at java.lang.reflect.Method.invoke(Method.java:515)
05-15 15:55:22.087: E/AndroidRuntime(20672): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-15 15:55:22.087: E/AndroidRuntime(20672): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-15 15:55:22.087: E/AndroidRuntime(20672): at dalvik.system.NativeStart.main(Native Method)
05-15 15:55:22.087: E/AndroidRuntime(20672): Caused by: java.lang.NullPointerException
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.Activity.findViewById(Activity.java:1884)
05-15 15:55:22.087: E/AndroidRuntime(20672): at com.example.keyboardlistener.MainActivity.<init>(MainActivity.java:18)
05-15 15:55:22.087: E/AndroidRuntime(20672): at java.lang.Class.newInstanceImpl(Native Method)
05-15 15:55:22.087: E/AndroidRuntime(20672): at java.lang.Class.newInstance(Class.java:1208)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
05-15 15:55:22.087: E/AndroidRuntime(20672): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
05-15 15:55:22.087: E/AndroidRuntime(20672): ... 11 more
05-15 16:00:21.837: I/dalvikvm(22483): Debugger is active
05-15 16:00:21.847: I/System.out(22483): Debugger has connected
05-15 16:00:21.857: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:22.057: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:22.257: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:22.457: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:22.657: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:22.857: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:23.057: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:23.257: I/System.out(22483): waiting for debugger to settle...
05-15 16:00:23.457: I/System.out(22483): debugger has settled (1495)
05-15 16:00:23.797: D/dalvikvm(22483): threadid=1: still suspended after undo (sc=1 dc=1)
05-15 16:09:43.367: D/AndroidRuntime(24025): Shutting down VM
05-15 16:09:43.367: W/dalvikvm(24025): threadid=1: thread exiting with uncaught exception (group=0x41ea1ba8)
05-15 16:09:43.367: E/AndroidRuntime(24025): FATAL EXCEPTION: main
05-15 16:09:43.367: E/AndroidRuntime(24025): Process: com.example.keyboardlistener, PID: 24025
05-15 16:09:43.367: E/AndroidRuntime(24025): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.keyboardlistener/com.example.keyboardlistener.MainActivity}: java.lang.NullPointerException
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.os.Handler.dispatchMessage(Handler.java:102)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.os.Looper.loop(Looper.java:136)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-15 16:09:43.367: E/AndroidRuntime(24025): at java.lang.reflect.Method.invokeNative(Native Method)
05-15 16:09:43.367: E/AndroidRuntime(24025): at java.lang.reflect.Method.invoke(Method.java:515)
05-15 16:09:43.367: E/AndroidRuntime(24025): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-15 16:09:43.367: E/AndroidRuntime(24025): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-15 16:09:43.367: E/AndroidRuntime(24025): at dalvik.system.NativeStart.main(Native Method)
05-15 16:09:43.367: E/AndroidRuntime(24025): Caused by: java.lang.NullPointerException
05-15 16:09:43.367: E/AndroidRuntime(24025): at com.example.keyboardlistener.MainActivity.onCreate(MainActivity.java:35)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.Activity.performCreate(Activity.java:5231)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-15 16:09:43.367: E/AndroidRuntime(24025): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
05-15 16:09:43.367: E/AndroidRuntime(24025): ... 11 more
And here is the onCreate method:
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
final EditText ed = (EditText)findViewById(R.id.editTextUserEntry1);
final TextView tv = (TextView)findViewById(R.id.TextResults);
ed.setOnKeyListener(new OnKeyListener(){
@override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if(event.getAction()==KeyEvent.ACTION_DOWN)
{
if(keyCode == KeyEvent.KEYCODE_ENTER)
{
tv.setText(ed.getText());
}
}
return false;
}
});
}
Hi,
to understand the logs, please read this guide on debugging apps. It tells you all you need to know to find your bug. (In this case, have a look at line 35, probably one of the IDs you pass to findViewById does not match the one you have your view set to in the XML layout file)
Declare tv and ed as fields and then this should work. The problem is, i think, that you only declared them temporarily inside onCreate, which doesn't let them being used in another method
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.krishn
package com.example.krishnaupaharaa;
import java.util.ArrayList;
import beanClass.Bfs;
import beanClass.ItemVO;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
public class CategoryList extends Activity {
ItemVO details;
Bfs categoryDetails;
ArrayList<ItemVO> itemList;
ArrayAdapter<String> arrayAdapter;
ListView lv;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_item_name);
itemList = new ArrayList<ItemVO>();
details = (ItemVO) ApplicationCache.getInstance().getValue("categoryDetails");
categoryDetails = (Bfs) ApplicationCache.getInstance().getValue("customerNameDetails");
//Log.d("TestTag", "Website address"+details.getMerchantWebsite());
//itemList = (ArrayList<ItemVO>) ApplicationCache.getInstance().getValue("customerNameDetails");
itemList = categoryDetails.getCategoryNameDetails();
//final LinkedHashMap<String,MFunctionVO> map = details.getMerchantFunctionalities();
lv = (ListView) findViewById(R.id.list1);
//String name = null;
arrayAdapter = new ArrayAdapter<String>(this,R.layout.listview_items,R.id.textView);
//arrayAdapter.add(details.getMerchantName());
//for(String s: map.keySet()){
// arrayAdapter.add(s);
//}
for (ItemVO mnvo : categoryDetails.getCategoryNameDetails())
{
Log.d("TestTag", "Name of custome care"+mnvo.getCategoryName());
arrayAdapter.add(mnvo.getCategoryName());
}
//lv.setAdapter(arrayAdapter);
lv.setAdapter(new MyAdapter(CategoryList.this,R.id.textView,itemList));
//Log.d("TestTag", "Values in details:" +details.getMerchantName());
//Log.d("TestTag", "Name in MerchantType class"+name);
lv.setOnItemClickListener(new OnItemClickListener() {
@override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
ApplicationCache.getInstance().setValue("merchantSpecificDetails", itemList.get(position));
Intent merchantIntent = new Intent(CategoryList.this,MyCart.class);
startActivity(merchantIntent);
}
});
}
private class MyAdapter extends ArrayAdapter<ItemVO>
{
private Context context;
private ArrayList<ItemVO> list;
public MyAdapter (Context context, int textViewResourceId, ArrayList<ItemVO> list)
{
super(context, textViewResourceId, list);
this.context = context;
this.list = list;
}
@override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
//return super.getView(position, convertView, parent);
{
LayoutInflater li = (LayoutInflater) getSystemService(context.LAYOUT_INFLATER_SERVICE);
convertView = li.inflate(R.layout.listview_items,null);
ImageView image=(ImageView) convertView.findViewById(R.id.imageView);
TextView itemName = (TextView) convertView.findViewById(R.id.textView);
String uri = "C:/Users/Deepak/workspace/KrishnaUpaharaa/res/drawable-hdpi" + list.get(position).getItemphoto();
Uri imguri = Uri.parse(uri);
Log.d("TestTag", "Inside getView"+list.get(position).getItemdescription());
image.setImageURI(imguri);
itemName.setText(list.get(position).getItemdescription());
return convertView;
}
}
}
}
Masrepus said:
Declare tv and ed as fields and then this should work. The problem is, i think, that you only declared them temporarily inside onCreate, which doesn't let them being used in another method
Click to expand...
Click to collapse
It not the problem. Both fields are final, so the values are copied to the instance of anonymous inner class via auto-generated constructor, thus both fields can be used inside of the instance of inner class.
I'm trying to make QuickMemo work on CM... So far it's not going anywhere as I'm kinda noob with Android... And I'm hoping someone with more knowledge can help me!
I copied LGQMemo.apk to /system/priv-app and was able to run it through Secure settings Launch activity and here is what I got in return:
06-11 11:54:48.412 I/ActivityManager( 826): START u0 {flg=0x10000000 cmp=com.lge.QuickClip/.QuickClipActivity} from pid 8370
06-11 11:54:48.422 I/SecureSettings.ActionService( 8370): onHandleIntent::Action Success
06-11 11:54:48.422 V/Zygote ( 8527): Switching descriptor 42 to /dev/null
06-11 11:54:48.422 V/Zygote ( 8527): Switching descriptor 9 to /dev/null
06-11 11:54:48.422 I/ActivityManager( 826): Start proc com.lge.QuickClip for activity com.lge.QuickClip/.QuickClipActivity: pid=8527 uid=10149 gids={50149, 1028, 1015}
06-11 11:54:48.462 I/dalvikvm( 8527): DexOpt: mismatch dep name: '/data/dalvik-cache/[email protected]@[email protected]' vs. '/system/framework/core.odex'
06-11 11:54:48.462 E/dalvikvm( 8527): /system/priv-app/LGQMemo.apk odex has stale dependencies
06-11 11:54:48.462 D/ActivityThread( 8527): handleBindApplication:com.lge.QuickClip
06-11 11:54:48.462 D/ActivityThread( 8527): setTargetHeapUtilization:0.75
06-11 11:54:48.462 D/ActivityThread( 8527): setTargetHeapMinFree:2097152
06-11 11:54:48.462 W/dalvikvm( 8527): Unable to resolve superclass of Lcom/lge/QuickClip/QuickClipActivity; (270)
06-11 11:54:48.462 W/dalvikvm( 8527): Link of class 'Lcom/lge/QuickClip/QuickClipActivity;' failed
06-11 11:54:48.462 D/AndroidRuntime( 8527): Shutting down VM
06-11 11:54:48.462 W/dalvikvm( 8527): threadid=1: thread exiting with uncaught exception (group=0x419b2ce0)
06-11 11:54:48.472 E/AndroidRuntime( 8527): FATAL EXCEPTION: main
06-11 11:54:48.472 E/AndroidRuntime( 8527): Process: com.lge.QuickClip, PID: 8527
06-11 11:54:48.472 E/AndroidRuntime( 8527): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.lge.QuickClip/com.lge.QuickClip.QuickClipActivity}: java.lang.ClassNotFoundException: Didn't find class "com.lge.QuickClip.QuickClipActivity" on path: DexPathList[[zip file "/system/priv-app/LGQMemo.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2120)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2253)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.access$800(ActivityThread.java:145)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.os.Handler.dispatchMessage(Handler.java:102)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.os.Looper.loop(Looper.java:136)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.main(ActivityThread.java:5128)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.reflect.Method.invokeNative(Native Method)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.reflect.Method.invoke(Method.java:515)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at dalvik.system.NativeStart.main(Native Method)
06-11 11:54:48.472 E/AndroidRuntime( 8527): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.lge.QuickClip.QuickClipActivity" on path: DexPathList[[zip file "/system/priv-app/LGQMemo.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
06-11 11:54:48.472 E/AndroidRuntime( 8527): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-11 11:54:48.472 E/AndroidRuntime( 8527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2111)
06-11 11:54:48.472 E/AndroidRuntime( 8527): ... 12 more
06-11 11:54:48.472 W/ActivityManager( 826): Force finishing activity com.lge.QuickClip/.QuickClipActivity
06-11 11:54:48.472 W/InputMethodManagerService( 826): Window already focused, ignoring focus gain of: [email protected] attribute=null, token = [email protected]
06-11 11:54:48.972 W/ActivityManager( 826): Activity pause timeout for ActivityRecord{424ae208 u0 com.lge.QuickClip/.QuickClipActivity t15 f}
06-11 11:54:49.022 I/Timeline( 1458): Timeline: Activity_idle id: [email protected] time:413509
06-11 11:54:49.482 D/qcom_sensors_hal( 826): hal_sensor1_data_cb: msg_type 2
06-11 11:54:49.922 I/Process ( 8527): Sending signal. PID: 8527 SIG: 9
06-11 11:54:49.932 D/PhoneStatusBar( 1239): disable: < expand icons alerts ticker system_info back home recent CLOCK* search >
06-11 11:54:49.932 W/InputMethodManagerService( 826): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$S[email protected] attribute=null, token = [email protected]
06-11 11:54:49.932 I/ActivityManager( 826): Process com.lge.QuickClip (pid 8527) has died.
Click to expand...
Click to collapse
Since I cannot install it directly, I was wondering why can the Secure Settings find the application and it's main activity but in the logcat it says it cannot be found?
Thanks in advance! (QMemo and QMemo.odex taken from latest CloudyFlex 2.4)
You may want to look for his people got the remote working. Pretty sure it looks for the eula being agreed to before it works
Sent from my LG-VS980 using Tapatalk
Hummm... But wouldn't it need to be shown on the EULA when you first start the system? As I recall, only the remote and VuTalk where shown...
I tried copying some files the the system/framework folder and got a reboot AND system format for free! Had to reinstall CM! Damn! (as I said I'm not a android/linux expert hehehe)
I am getting a NullPointerException after the build but once my phone tries to launch the app. I do not understand where the problem is. Im just learning to code and this app is simply supposed to make a toast pop up Long if the checkbox is clicked and short if it isnt.
Code:
package universaltruth.toastee;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends ActionBarActivity {
public CheckBox longToast = (CheckBox) findViewById(R.id.checkbox);
public EditText editText = (EditText) findViewById(R.id.toastText);
public int toastLength = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
addListenerOnlongToast();
}
public void addListenerOnlongToast(){
longToast.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if(((CheckBox) view).isChecked()){
toastLength = '1';
}
}
});
}
public void toastMessage(View view){
String message = editText.getText().toString();
Toast.makeText(getApplicationContext(),message, (toastLength == 0) ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG).show();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
LogCat:
02-08 12:48:34.718 6684-6684/universaltruth.toastee D/AndroidRuntime﹕ Shutting down VM
02-08 12:48:34.718 6684-6684/universaltruth.toastee W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x4191bda0)
02-08 12:48:34.718 6684-6684/universaltruth.toastee E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: universaltruth.toastee, PID: 6684
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{universaltruth.toastee/universaltruth.toastee.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.access$900(ActivityThread.java:174)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5748)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.Activity.findViewById(Activity.java:2014)
at universaltruth.toastee.MainActivity.<init>(MainActivity.java:19)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2399)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2599)
************at android.app.ActivityThread.access$900(ActivityThread.java:174)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
************at android.os.Handler.dispatchMessage(Handler.java:102)
************at android.os.Looper.loop(Looper.java:146)
************at android.app.ActivityThread.main(ActivityThread.java:5748)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:515)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
************at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
************at dalvik.system.NativeStart.main(Native Method)
02-08 13:00:50.672 9121-9121/universaltruth.toastee I/SELinux﹕ Function: selinux_android_load_priority , priority [3] , priority version is VE=SEPF_SM-N910F_4.4.4_A024
02-08 13:00:50.672 9121-9121/universaltruth.toastee E/SELinux﹕ [DEBUG] get_category: variable seinfocat: default sensitivity: NULL, cateogry: NULL
02-08 13:00:50.672 9121-9121/universaltruth.toastee E/dalvikvm﹕ >>>>> Normal User
02-08 13:00:50.672 9121-9121/universaltruth.toastee E/dalvikvm﹕ >>>>> universaltruth.toastee [ userId:0 | appId:10384 ]
02-08 13:00:50.682 9121-9121/universaltruth.toastee E/SELinux﹕ [DEBUG] get_category: variable seinfocat: default sensitivity: NULL, cateogry: NULL
02-08 13:00:50.682 9121-9121/universaltruth.toastee D/dalvikvm﹕ Late-enabling CheckJNI
02-08 13:00:50.682 9121-9121/universaltruth.toastee I/libpersona﹕ KNOX_SDCARD checking this for 10384
02-08 13:00:50.682 9121-9121/universaltruth.toastee I/libpersona﹕ KNOX_SDCARD not a persona
02-08 13:00:50.752 9121-9121/universaltruth.toastee D/TimaKeyStoreProvider﹕ in addTimaSignatureService
02-08 13:00:50.762 9121-9121/universaltruth.toastee D/TimaKeyStoreProvider﹕ Cannot add TimaSignature Service, License check Failed
02-08 13:00:50.762 9121-9121/universaltruth.toastee D/ActivityThread﹕ Added TimaKesytore provider
02-08 13:00:50.922 9121-9121/universaltruth.toastee D/AndroidRuntime﹕ Shutting down VM
02-08 13:00:50.922 9121-9121/universaltruth.toastee W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x4191bda0)
02-08 13:00:50.922 9121-9121/universaltruth.toastee E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: universaltruth.toastee, PID: 9121
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{universaltruth.toastee/universaltruth.toastee.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.access$900(ActivityThread.java:174)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5748)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.Activity.findViewById(Activity.java:2014)
at universaltruth.toastee.MainActivity.<init>(MainActivity.java:16)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2399)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2599)
************at android.app.ActivityThread.access$900(ActivityThread.java:174)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
************at android.os.Handler.dispatchMessage(Handler.java:102)
************at android.os.Looper.loop(Looper.java:146)
************at android.app.ActivityThread.main(ActivityThread.java:5748)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:515)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
************at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
************at dalvik.system.NativeStart.main(Native Method)
02-08 13:00:55.232 9121-9121/universaltruth.toastee I/Process﹕ Sending signal. PID: 9121 SIG: 9
Forgive me if I am not posting this correctly. This is my first time. I am open to any and all feedback. Thank you.
Your problem is that you initialize the longToast checkbox outside of a method. But findViewById only returns a result if called after a call to setContentView(...), which is done in onCreate. So: put your initialization code into onCreate, after setContentView and it will work fine
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Masrepus said:
Your problem is that you initialize the longToast checkbox outside of a method. But findViewById only returns a result if called after a call to setContentView(...), which is done in onCreate. So: put your initialization code into onCreate, after setContentView and it will work fine
Click to expand...
Click to collapse
Hey Masrepus,
Thanks a bunch for answering me.
I have moved the initializations to the on create after the setContentView. I am still getting the null pointer exception. Do you have any further advice?
UniversalTruth said:
Hey Masrepus,
Thanks a bunch for answering me.
I have moved the initializations to the on create after the setContentView. I am still getting the null pointer exception. Do you have any further advice?
Click to expand...
Click to collapse
Can you edit the first post with the new code (and new logcat)?
Yes, grab a new log and post it on pastebin
Then link the log from here