久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

不幸的是 <applicationName>已經停止

unfortunately lt;applicationNamegt; has stopped(不幸的是 lt;applicationNamegt;已經停止)
本文介紹了不幸的是 <applicationName>已經停止的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

所以我不知道這里關于雙重帖子的規則是什么,任何我沒有在我的其他問題上獲得后續支持的人.. 任何我的問題被陳述的人,這是我的 logcat

So i don't know what the rules are here about double posts, anywho i didn't get follow up support on my other question.. anywho my problem is stated, heres my logcat

05-28 19:45:03.464: I/ActivityManager(274): Start proc xela.kasea.flyffresell for activity xela.kasea.flyffresell/.Main: pid=793 uid=10046 gids={50046, 1028}
05-28 19:45:03.474: D/dalvikvm(793): Not late-enabling CheckJNI (already on)
05-28 19:45:04.154: I/ARMAssembler(36): generated scanline__00000077:03010104_00008001_00000000 [ 89 ipp] (110 ins) at [0x41548840:0x415489f8] in 564149 ns
05-28 19:45:04.294: D/dalvikvm(793): GC_FOR_ALLOC freed 81K, 6% free 2642K/2784K, paused 26ms, total 27ms
05-28 19:45:04.294: I/dalvikvm-heap(793): Grow heap (frag case) to 3.318MB for 714016-byte allocation
05-28 19:45:04.334: D/dalvikvm(793): GC_FOR_ALLOC freed 2K, 5% free 3337K/3484K, paused 34ms, total 34ms
05-28 19:45:04.414: I/Tag2(793): This is my error msg
05-28 19:45:04.414: D/AndroidRuntime(793): Shutting down VM
05-28 19:45:04.414: W/dalvikvm(793): threadid=1: thread exiting with uncaught exception (group=0x41465700)
05-28 19:45:04.425: E/AndroidRuntime(793): FATAL EXCEPTION: main
05-28 19:45:04.425: E/AndroidRuntime(793): java.lang.RuntimeException: Unable to start activity ComponentInfo{xela.kasea.flyffresell/xela.kasea.flyffresell.Main}: java.lang.NullPointerException
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.os.Looper.loop(Looper.java:137)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.ActivityThread.main(ActivityThread.java:5103)
05-28 19:45:04.425: E/AndroidRuntime(793):  at java.lang.reflect.Method.invokeNative(Native Method)
05-28 19:45:04.425: E/AndroidRuntime(793):  at java.lang.reflect.Method.invoke(Method.java:525)
05-28 19:45:04.425: E/AndroidRuntime(793):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
05-28 19:45:04.425: E/AndroidRuntime(793):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-28 19:45:04.425: E/AndroidRuntime(793):  at dalvik.system.NativeStart.main(Native Method)
05-28 19:45:04.425: E/AndroidRuntime(793): Caused by: java.lang.NullPointerException
05-28 19:45:04.425: E/AndroidRuntime(793):  at xela.kasea.flyffresell.Main.onCreate(Main.java:31)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.Activity.performCreate(Activity.java:5133)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-28 19:45:04.425: E/AndroidRuntime(793):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
05-28 19:45:04.425: E/AndroidRuntime(793):  ... 11 more
05-28 19:45:04.433: W/ActivityManager(274):   Force finishing activity xela.kasea.flyffresell/.Main
05-28 19:45:04.743: I/WindowManager(274): Screenshot max retries 4 of Token{41792b40 ActivityRecord{418a4ce0 u0 xela.kasea.flyffresell/.Main}} appWin=Window{41943b50 u0 Starting xela.kasea.flyffresell} drawState=4
05-28 19:45:04.743: W/WindowManager(274): Screenshot failure taking screenshot for (400x800) to layer 21010
05-28 19:45:05.133: D/AlertService(580): Beginning updateAlertNotification
05-28 19:45:05.214: D/AlertService(580): No fired or scheduled alerts
05-28 19:45:05.263: W/ActivityManager(274): Activity pause timeout for ActivityRecord{418a4ce0 u0 xela.kasea.flyffresell/.Main}
05-28 19:45:05.593: D/AlertService(580): Scheduling next alarm with AlarmScheduler. sEventReminderReceived: null
05-28 19:45:05.853: D/AlarmScheduler(580): No events found starting within 1 week.
05-28 19:45:06.503: I/Process(793): Sending signal. PID: 793 SIG: 9
05-28 19:45:06.513: I/ActivityManager(274): Process xela.kasea.flyffresell (pid 793) has died.

這是我的 main.java.注意:我只使用一個類.

and heres my main.java. Note: i am only using one class.

package xela.kasea.flyffresell;


import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ToggleButton;

public class Main extends Activity implements OnClickListener{

    EditText perin, amountPrUnit, buy, sell;
    ToggleButton lazy;
    Button clear, submit, ret;
    double ans, subAnswer;
    TextView pEarned, tAmount;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.display);
        Log.i("Tag2", "This is my error msg");
        initalizer();
        lazy.setOnClickListener(this);
        clear.setOnClickListener(this);
        submit.setOnClickListener(this);
        ret.setOnClickListener(this);
        /*String a = perin.getText().toString();
        String b = amountPrUnit.getText().toString();
        String c = buy.getText().toString();
        String d = sell.getText().toString(); */
    }

    private void initalizer() {
        // TODO Auto-generated method stub
        perin = (EditText) findViewById(R.id.etHowRich);
        amountPrUnit =  (EditText) findViewById(R.id.etAmountPrUnit);
        buy = (EditText) findViewById(R.id.etBuying);
        sell = (EditText) findViewById(R.id.etSellingPrUnit);
        lazy = (ToggleButton) findViewById(R.id.tbBuying);
        clear = (Button) findViewById(R.id.bClear);
        submit = (Button) findViewById(R.id.bSubmit);
        ret = (Button) findViewById(R.id.bReturn);
        pEarned = (TextView) findViewById(R.id.tvEarned);
        tAmount = (TextView) findViewById(R.id.tvAmount);
        /*int a = Integer.parseInt(perin.getText().toString());
        int b = Integer.parseInt(amountPrUnit.getText().toString());
        int c = Integer.parseInt(buy.getText().toString());
        int d = Integer.parseInt(sell.getText().toString());*/
    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        int a = Integer.parseInt(perin.getText().toString());
        int b = Integer.parseInt(amountPrUnit.getText().toString());
        int c = Integer.parseInt(buy.getText().toString());
        int d = Integer.parseInt(sell.getText().toString());
        switch(v.getId()){
        case R.id.bClear:
            perin.setText("");
            amountPrUnit.setText("");
            buy.setText("");
            sell.setText("");
            lazy.setChecked(false);
            break;
        case R.id.bReturn:
            setContentView(R.layout.display);
            break;
        case R.id.bSubmit:
            pEarned.setText(c*d-(a-(b*c)));
            tAmount.setText(c*d+(a-(a-(b*c))));
            setContentView(R.layout.finish);
            break;
        case R.id.tbBuying:
            if (lazy.isChecked()){
            buy.setText("");
            double subAnswer = 0;
            int ans = 0;
            subAnswer = a/b;
            ans = (int) Math.floor(subAnswer);
            /*new Integer((int) ans).toString();
            Integer.toString(answer);*/
            buy.setText(ans);;
            }
            break;
        }
    }
}

這個應用程序要做的是,獲取幾個用戶輸入的數字并用它們做一些數學運算.

what this app is suppose to do is, take a couple of user inputted numbers and do some math with them.

如果你需要,這里是清單

and if you need it, heres the manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="xela.kasea.flyffresell"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Main"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

推薦答案

我認為用戶的這條評論需要一個解釋 null 在 Java 中的基本主題的答案:

I think this comment from the user requires an answer that explains the fundamental topic of what null is in Java:

如果我可能會問,什么是 NullPointerException?

if i may ask, whats a NullPointerException?

null 指針意味著您正在嘗試操作一個沒有分配任何內存的 Object 變量.NullPointerException 是 Java 告訴你的方式:嘿,你試圖操作的變量(即設置一個監聽器)沒有指向內存位置;沒有 Object 已為此變量實例化,或者它已經被垃圾回收.您正試圖去使用尚未建造的建筑物的浴室."

null pointer means that you are trying to manipulate an Object variable that does not have any memory allocated to it. The NullPointerException is Java's way of telling you: "Hey, the variable that you are trying to manipulate (i.e. set a listener to) is pointing to no memory location; there was no Object instantiated for this variable or it was already garbage collected. You are trying to go to use the bathroom of a building that hasn't been built yet."

堆棧跟蹤很好(你應該和他成為朋友)并告訴我們在哪一行代碼中拋出了 Exception:

The stacktrace is nice (you should be friends with him) and tells us in which line of our code the Exception is thrown:

05-28 19:45:04.425: E/AndroidRuntime(793): Caused by: java.lang.NullPointerException 
05-28 19:45:04.425: E/AndroidRuntime(793):  at xela.kasea.flyffresell.Main.onCreate(Main.java:31)

這意味著你需要去檢查那行代碼并找出哪個變量是null.大多數現代 IDE 都可以選擇引入斷點,讓您可以在運行時查看變量的狀態.一旦您知道哪個變量是 null,您就可以更輕松地找出原因.因此,在您的情況下,導致問題的行是 Main.java 的第 31 行.從評論中我們知道你說那行是:

This means that you need to go and check that line of code and figure out which variable is null. Most modern IDE's have the option of introducing breakpoints that allow you to see a variable's state at runtime. Once you know which variable is null you can more easily figure out why. So in your case, the line causing problems is line 31 of Main.java. From the comments we know you said that line is:

ret.setOnClickListender(this);

這給我們留下了一個選擇;ret 必須為 null.然后我們問自己:

That leave us with one option; ret has to be null. Then we ask ourselves:

在正常情況下會發生什么情況,會使 ret 為 null?

What can happen, under normal conditions, that can make ret be null?

1) 變量未初始化;我們忘了初始化它.不是我們的情況.

1) The variable is not initialized; we forgot to initialize it. Not our case.

2) 變量被垃圾回收.不是我們的情況.

2) The variable was garbaged collected. Not our case.

3) 嘗試初始化變量時出現問題.可能是我們的情況.

3) Something went wrong when we tried to initialize our variable. Probably our case.

在這種情況下,我們不會通過調用某個類的構造函數來初始化變量,而是通過方法(即 findViewById())來初始化變量.這個方法需要一個 int,它應該是我們想要設置 retViewid,它返回 null 或有問題的 View.所以,如果考慮正確的話,錯誤可能是我們使用了錯誤的 id.

In this case, we do not initialize the variable by calling the constructor of some class, we do it via a method (i.e. findViewById()). This method takes an int that should be the id of the View we want to set ret to, and it either returns null or the View in question. So, if thought this out correctly, the error probably is that we used the wrong id.

這個答案更多的是展示一種思維模式,而不是一個實際的解決方案,因為確實沒有足夠的信息來解決這個問題.

This answer is more to show a thinking pattern rather than an actual solution since there really is not enough information to solve the problem.

這篇關于不幸的是 &lt;applicationName&gt;已經停止的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉換為公歷?)
Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日歷到日期轉換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
Java: getting current Day of the Week value(Java:獲取當前星期幾的值)
主站蜘蛛池模板: 午夜视频在线播放 | 一区二区三区欧美在线观看 | 91精品一区二区三区久久久久 | 日韩一区二区三区视频 | 日韩精品成人 | 综合久久色 | 91传媒在线播放 | 日韩综合在线视频 | 国产精品xxxx | 99精品视频免费观看 | 日本免费一区二区三区 | 日本午夜一区二区三区 | 欧美天堂一区 | 黄色片av| 精品国产乱码久久久久久闺蜜 | 99精品热视频 | 精品久久九 | 69堂永久69tangcom | 国产精品91久久久久久 | 国产69精品久久99不卡免费版 | 亚洲毛片在线观看 | 久久在看 | 免费一区二区三区在线视频 | 波多野结衣一区二区三区在线观看 | 1000部精品久久久久久久久 | 久热久热 | 在线观看国产wwwa级羞羞视频 | 日本成人免费网站 | 亚洲福利| 国产一区精品在线 | 国产精品久久久久久中文字 | 99这里只有精品视频 | 亚洲国产aⅴ成人精品无吗 综合国产在线 | 国产黄色精品在线观看 | 中文字幕 亚洲一区 | 欧美三级在线 | 中文字幕不卡在线观看 | 久久五月婷| 99成人免费视频 | 在线观看欧美日韩视频 | 91久久国产精品 |