无法使用扩展 SeekBar 的自己的类运行 Android 应用程序

发布于 2024-10-29 06:19:36 字数 13052 浏览 2 评论 0原文

我正在尝试编写 SeekBar 的扩展来自定义它的行为。

我在让新类的最基本形式在模拟器中运行时遇到问题。

我什至无法获得一个不添加任何新功能来启动的类。

谁能告诉我我在这里错过了什么基本的东西? 当我尝试使用 ExtendedSeekBar 时,为什么应用程序无法正确初始化? 在哪里可以找到已发生的异常的详细信息?

我在 XP 上运行 Eclipse,使用 Android SDK 工具修订版 10。 我还应该提供哪些其他信息?

感谢您的任何帮助。


这是我正在尝试做的事情的细节。

从 Hello World 教程应用程序开始,我扩展 main.xml 以包含标准 SeekBar 并更新 HelloAndroid.java 以查找对象并将进度设置为 25。

这是 main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<SeekBar
    android:id="@+id/SeekBar01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    />
</LinearLayout>

这是 HelloAndroid.java:

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.SeekBar;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        SeekBar vSeekBar1 = (SeekBar)findViewById(R.id.SeekBar01);
        vSeekBar1.setProgress(25);
    }
}

我运行这个,没有问题,SeekBar 出现在模拟器上的应用程序中,并且进度设置正确,

到目前为止没有问题...


所以,现在我想开始扩展 SeekBar。

我更新 main.xml 以将 SeekBar 更改为 ExtendedSeekbar

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<ExtendedSeekBar
    android:id="@+id/SeekBar01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    />
</LinearLayout>

和 HelloAndroid.java 以查找新对象

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.SeekBar;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ExtendedSeekBar vSeekBar1 = (ExtendedSeekBar)findViewById(R.id.SeekBar01);
        vSeekBar1.setProgress(25);
    }
}

我创建一个新类,其中仅包含新的构造函数和每个构造函数调用的初始化函数(因此我可以设置单个断点

) .java

package com.example.helloandroid;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.SeekBar;

public class ExtendedSeekBar extends SeekBar {

    public ExtendedSeekBar(Context context) {
        super(context);
        Initialise();
    }

    public ExtendedSeekBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        Initialise();
    }

    public ExtendedSeekBar(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        Initialise();
    }

    void Initialise(){
        Log.i("ESB","ExtendedSeekBar Initialise ");
    }
}

现在,当我运行它时,我会看到调试视图,并显示以下堆栈转储

HelloAndroid [Android Application]  
    DalvikVM[localhost:8628]    
        Thread [<1> main] (Suspended (exception RuntimeException))  
            ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1647    
            ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1663 
            ActivityThread.access$1500(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 117   
            ActivityThread$H.handleMessage(Message) line: 931   
            ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
            Looper.loop() line: 123 
            ActivityThread.main(String[]) line: 3683    
            Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
            Method.invoke(Object, Object...) line: 507  
            ZygoteInit$MethodAndArgsCaller.run() line: 839  
            ZygoteInit.main(String[]) line: 597 
            NativeStart.main(String[]) line: not available [native method]  
        Thread [<8> Binder Thread #2] (Running) 
        Thread [<7> Binder Thread #1] (Running) 

LogCat 窗口包含以下内容

03-31 17:44:56.628: DEBUG/AndroidRuntime(589): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
03-31 17:44:56.628: DEBUG/AndroidRuntime(589): CheckJNI is ON
03-31 17:44:57.518: DEBUG/AndroidRuntime(589): Calling main entry com.android.commands.pm.Pm
03-31 17:44:57.749: DEBUG/dalvikvm(239): GC_EXPLICIT freed 3K, 54% free 2544K/5511K, external 410K/517K, paused 72ms
03-31 17:44:57.759: WARN/ActivityManager(61): No content provider found for: 
03-31 17:44:57.778: WARN/ActivityManager(61): No content provider found for: 
03-31 17:44:57.817: DEBUG/PackageParser(61): Scanning package: /data/app/vmdl-558475578.tmp
03-31 17:44:57.909: INFO/PackageManager(61): Removing non-system package:com.example.helloandroid
03-31 17:44:57.909: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:44:57.979: INFO/Process(61): Sending signal. PID: 577 SIG: 9
03-31 17:44:58.009: INFO/WindowManager(61): WIN DEATH: Window{40657ca8 com.example.helloandroid/com.example.helloandroid.HelloAndroid paused=false}
03-31 17:44:58.159: WARN/InputManagerService(61): Got RemoteException sending setActive(false) notification to pid 577 uid 10037
03-31 17:44:58.597: DEBUG/dalvikvm(61): GC_CONCURRENT freed 483K, 42% free 4431K/7623K, external 809K/1222K, paused 8ms+9ms
03-31 17:44:58.748: DEBUG/PackageManager(61): Scanning package com.example.helloandroid
03-31 17:44:58.748: INFO/PackageManager(61): Package com.example.helloandroid codePath changed from /data/app/com.example.helloandroid-1.apk to /data/app/com.example.helloandroid-2.apk; Retaining data and using new
03-31 17:44:58.768: INFO/PackageManager(61): Unpacking native libraries for /data/app/com.example.helloandroid-2.apk
03-31 17:44:58.798: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/com.example.helloandroid-2.apk' ---
03-31 17:44:59.038: DEBUG/dalvikvm(598): DexOpt: load 62ms, verify+opt 15ms
03-31 17:44:59.058: DEBUG/installd(35): DexInv: --- END '/data/app/com.example.helloandroid-2.apk' (success) ---
03-31 17:44:59.058: WARN/PackageManager(61): Code path for pkg : com.example.helloandroid changing from /data/app/com.example.helloandroid-1.apk to /data/app/com.example.helloandroid-2.apk
03-31 17:44:59.058: WARN/PackageManager(61): Resource path for pkg : com.example.helloandroid changing from /data/app/com.example.helloandroid-1.apk to /data/app/com.example.helloandroid-2.apk
03-31 17:44:59.058: DEBUG/PackageManager(61):   Activities: com.example.helloandroid.HelloAndroid
03-31 17:44:59.078: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:44:59.178: INFO/installd(35): move /data/dalvik-cache/data@[email protected]@classes.dex -> /data/dalvik-cache/data@[email protected]@classes.dex
03-31 17:44:59.178: DEBUG/PackageManager(61): New package installed in /data/app/com.example.helloandroid-2.apk
03-31 17:44:59.278: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:44:59.369: DEBUG/dalvikvm(129): GC_EXPLICIT freed 3K, 53% free 2850K/5959K, external 1527K/1970K, paused 72ms
03-31 17:44:59.621: WARN/RecognitionManagerService(61): no available voice recognition services found
03-31 17:44:59.958: DEBUG/dalvikvm(185): GC_EXPLICIT freed 94K, 52% free 2758K/5703K, external 410K/517K, paused 559ms
03-31 17:45:00.098: DEBUG/dalvikvm(61): GC_EXPLICIT freed 474K, 43% free 4349K/7623K, external 807K/1222K, paused 138ms
03-31 17:45:00.198: INFO/installd(35): unlink /data/dalvik-cache/data@[email protected]@classes.dex
03-31 17:45:00.218: DEBUG/AndroidRuntime(589): Shutting down VM
03-31 17:45:00.249: DEBUG/dalvikvm(589): GC_CONCURRENT freed 101K, 72% free 295K/1024K, external 0K/0K, paused 2ms+2ms
03-31 17:45:00.249: DEBUG/jdwp(589): Got wake-up signal, bailing out of select
03-31 17:45:00.249: DEBUG/dalvikvm(589): Debugger has detached; object registry had 1 entries
03-31 17:45:00.278: INFO/AndroidRuntime(589): NOTE: attach of thread 'Binder Thread #3' failed
03-31 17:45:01.029: DEBUG/AndroidRuntime(603): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
03-31 17:45:01.029: DEBUG/AndroidRuntime(603): CheckJNI is ON
03-31 17:45:01.978: DEBUG/AndroidRuntime(603): Calling main entry com.android.commands.am.Am
03-31 17:45:02.029: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:45:02.029: INFO/ActivityManager(61): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.helloandroid/.HelloAndroid } from pid 603
03-31 17:45:02.168: DEBUG/AndroidRuntime(603): Shutting down VM
03-31 17:45:02.199: INFO/ActivityManager(61): Start proc com.example.helloandroid for activity com.example.helloandroid/.HelloAndroid: pid=612 uid=10037 gids={}
03-31 17:45:02.248: INFO/AndroidRuntime(603): NOTE: attach of thread 'Binder Thread #3' failed
03-31 17:45:02.267: DEBUG/dalvikvm(603): GC_CONCURRENT freed 102K, 69% free 322K/1024K, external 0K/0K, paused 4ms+1ms
03-31 17:45:02.289: DEBUG/jdwp(603): Got wake-up signal, bailing out of select
03-31 17:45:02.289: DEBUG/dalvikvm(603): Debugger has detached; object registry had 1 entries
03-31 17:45:03.208: WARN/ActivityThread(612): Application com.example.helloandroid is waiting for the debugger on port 8100...
03-31 17:45:03.288: INFO/System.out(612): Sending WAIT chunk
03-31 17:45:03.298: INFO/dalvikvm(612): Debugger is active
03-31 17:45:03.358: INFO/System.out(612): Debugger has connected
03-31 17:45:03.409: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:03.608: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:03.808: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.018: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.218: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.419: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.628: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.828: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.038: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.248: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.449: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.648: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.859: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:06.058: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:06.268: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:06.479: INFO/System.out(612): debugger has settled (1340)
03-31 17:45:12.150: WARN/ActivityManager(61): Launch timeout has expired, giving up wake lock!
03-31 17:45:13.158: WARN/ActivityManager(61): Activity idle timeout for HistoryRecord{40556f78 com.example.helloandroid/.HelloAndroid}
03-31 17:45:18.238: DEBUG/dalvikvm(239): GC_EXPLICIT freed 6K, 54% free 2543K/5511K, external 410K/517K, paused 53ms
03-31 17:45:23.369: DEBUG/dalvikvm(287): GC_EXPLICIT freed 9K, 54% free 2597K/5639K, external 410K/517K, paused 119ms
03-31 17:45:28.339: DEBUG/dalvikvm(329): GC_EXPLICIT freed <1K, 54% free 2539K/5511K, external 410K/517K, paused 51ms
03-31 17:45:33.409: DEBUG/dalvikvm(129): GC_EXPLICIT freed 76K, 51% free 2929K/5959K, external 1542K/1970K, paused 110ms
03-31 17:45:38.949: DEBUG/SntpClient(61): request time failed: java.net.SocketException: Address family not supported by protocol

,应用程序出现在模拟器中,没有 main.xml 指定的任何项目,只有标题栏。没有遇到我在 ExtendedSeekBar::initialise 中设置的断点。

I'm trying to write an extension to SeekBar to customise it's behaviour.

I'm having problems getting the most basic form of the new class to run in the emulator.

I can't even get a class that doesn't add any new functionality to start up.

Can anybody tell me what basic thing I'm missing out here?
Why won't the app initialise correctly when I try to use an ExtendedSeekBar?
Where do I find details of the exception that has occurred?

I running Eclipse on XP, using Android SDK tools revision 10.
What other information should I provide?

Thanks for any help.


Here's the detail of what I'm trying to do.

Starting from the Hello World tutorial app I extend main.xml to include a standard SeekBar and update HelloAndroid.java to find the object and set the progress to 25.

Here's main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<SeekBar
    android:id="@+id/SeekBar01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    />
</LinearLayout>

and here's HelloAndroid.java:

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.SeekBar;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        SeekBar vSeekBar1 = (SeekBar)findViewById(R.id.SeekBar01);
        vSeekBar1.setProgress(25);
    }
}

I run this and, no problem, the SeekBar appears in the app on the emulator with tthe progress correctly set

No problems so far...


So, now I want to start to extend the SeekBar.

I update main.xml to change SeekBar to ExtendedSeekbar

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<ExtendedSeekBar
    android:id="@+id/SeekBar01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    />
</LinearLayout>

and HelloAndroid.java to find the new object

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.SeekBar;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ExtendedSeekBar vSeekBar1 = (ExtendedSeekBar)findViewById(R.id.SeekBar01);
        vSeekBar1.setProgress(25);
    }
}

I create a new class that just contains the new Constructors and an initialise function that is called by each constructor (so I can set a single breakpoint)

ExtendedSeekBar.java

package com.example.helloandroid;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.SeekBar;

public class ExtendedSeekBar extends SeekBar {

    public ExtendedSeekBar(Context context) {
        super(context);
        Initialise();
    }

    public ExtendedSeekBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        Initialise();
    }

    public ExtendedSeekBar(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        Initialise();
    }

    void Initialise(){
        Log.i("ESB","ExtendedSeekBar Initialise ");
    }
}

Now, when I run it I get the Debug View appear with the following stack dump

HelloAndroid [Android Application]  
    DalvikVM[localhost:8628]    
        Thread [<1> main] (Suspended (exception RuntimeException))  
            ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1647    
            ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1663 
            ActivityThread.access$1500(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 117   
            ActivityThread$H.handleMessage(Message) line: 931   
            ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
            Looper.loop() line: 123 
            ActivityThread.main(String[]) line: 3683    
            Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
            Method.invoke(Object, Object...) line: 507  
            ZygoteInit$MethodAndArgsCaller.run() line: 839  
            ZygoteInit.main(String[]) line: 597 
            NativeStart.main(String[]) line: not available [native method]  
        Thread [<8> Binder Thread #2] (Running) 
        Thread [<7> Binder Thread #1] (Running) 

The LogCat window contains the following

03-31 17:44:56.628: DEBUG/AndroidRuntime(589): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
03-31 17:44:56.628: DEBUG/AndroidRuntime(589): CheckJNI is ON
03-31 17:44:57.518: DEBUG/AndroidRuntime(589): Calling main entry com.android.commands.pm.Pm
03-31 17:44:57.749: DEBUG/dalvikvm(239): GC_EXPLICIT freed 3K, 54% free 2544K/5511K, external 410K/517K, paused 72ms
03-31 17:44:57.759: WARN/ActivityManager(61): No content provider found for: 
03-31 17:44:57.778: WARN/ActivityManager(61): No content provider found for: 
03-31 17:44:57.817: DEBUG/PackageParser(61): Scanning package: /data/app/vmdl-558475578.tmp
03-31 17:44:57.909: INFO/PackageManager(61): Removing non-system package:com.example.helloandroid
03-31 17:44:57.909: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:44:57.979: INFO/Process(61): Sending signal. PID: 577 SIG: 9
03-31 17:44:58.009: INFO/WindowManager(61): WIN DEATH: Window{40657ca8 com.example.helloandroid/com.example.helloandroid.HelloAndroid paused=false}
03-31 17:44:58.159: WARN/InputManagerService(61): Got RemoteException sending setActive(false) notification to pid 577 uid 10037
03-31 17:44:58.597: DEBUG/dalvikvm(61): GC_CONCURRENT freed 483K, 42% free 4431K/7623K, external 809K/1222K, paused 8ms+9ms
03-31 17:44:58.748: DEBUG/PackageManager(61): Scanning package com.example.helloandroid
03-31 17:44:58.748: INFO/PackageManager(61): Package com.example.helloandroid codePath changed from /data/app/com.example.helloandroid-1.apk to /data/app/com.example.helloandroid-2.apk; Retaining data and using new
03-31 17:44:58.768: INFO/PackageManager(61): Unpacking native libraries for /data/app/com.example.helloandroid-2.apk
03-31 17:44:58.798: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/com.example.helloandroid-2.apk' ---
03-31 17:44:59.038: DEBUG/dalvikvm(598): DexOpt: load 62ms, verify+opt 15ms
03-31 17:44:59.058: DEBUG/installd(35): DexInv: --- END '/data/app/com.example.helloandroid-2.apk' (success) ---
03-31 17:44:59.058: WARN/PackageManager(61): Code path for pkg : com.example.helloandroid changing from /data/app/com.example.helloandroid-1.apk to /data/app/com.example.helloandroid-2.apk
03-31 17:44:59.058: WARN/PackageManager(61): Resource path for pkg : com.example.helloandroid changing from /data/app/com.example.helloandroid-1.apk to /data/app/com.example.helloandroid-2.apk
03-31 17:44:59.058: DEBUG/PackageManager(61):   Activities: com.example.helloandroid.HelloAndroid
03-31 17:44:59.078: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:44:59.178: INFO/installd(35): move /data/dalvik-cache/data@[email protected]@classes.dex -> /data/dalvik-cache/data@[email protected]@classes.dex
03-31 17:44:59.178: DEBUG/PackageManager(61): New package installed in /data/app/com.example.helloandroid-2.apk
03-31 17:44:59.278: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:44:59.369: DEBUG/dalvikvm(129): GC_EXPLICIT freed 3K, 53% free 2850K/5959K, external 1527K/1970K, paused 72ms
03-31 17:44:59.621: WARN/RecognitionManagerService(61): no available voice recognition services found
03-31 17:44:59.958: DEBUG/dalvikvm(185): GC_EXPLICIT freed 94K, 52% free 2758K/5703K, external 410K/517K, paused 559ms
03-31 17:45:00.098: DEBUG/dalvikvm(61): GC_EXPLICIT freed 474K, 43% free 4349K/7623K, external 807K/1222K, paused 138ms
03-31 17:45:00.198: INFO/installd(35): unlink /data/dalvik-cache/data@[email protected]@classes.dex
03-31 17:45:00.218: DEBUG/AndroidRuntime(589): Shutting down VM
03-31 17:45:00.249: DEBUG/dalvikvm(589): GC_CONCURRENT freed 101K, 72% free 295K/1024K, external 0K/0K, paused 2ms+2ms
03-31 17:45:00.249: DEBUG/jdwp(589): Got wake-up signal, bailing out of select
03-31 17:45:00.249: DEBUG/dalvikvm(589): Debugger has detached; object registry had 1 entries
03-31 17:45:00.278: INFO/AndroidRuntime(589): NOTE: attach of thread 'Binder Thread #3' failed
03-31 17:45:01.029: DEBUG/AndroidRuntime(603): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
03-31 17:45:01.029: DEBUG/AndroidRuntime(603): CheckJNI is ON
03-31 17:45:01.978: DEBUG/AndroidRuntime(603): Calling main entry com.android.commands.am.Am
03-31 17:45:02.029: INFO/ActivityManager(61): Force stopping package com.example.helloandroid uid=10037
03-31 17:45:02.029: INFO/ActivityManager(61): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.helloandroid/.HelloAndroid } from pid 603
03-31 17:45:02.168: DEBUG/AndroidRuntime(603): Shutting down VM
03-31 17:45:02.199: INFO/ActivityManager(61): Start proc com.example.helloandroid for activity com.example.helloandroid/.HelloAndroid: pid=612 uid=10037 gids={}
03-31 17:45:02.248: INFO/AndroidRuntime(603): NOTE: attach of thread 'Binder Thread #3' failed
03-31 17:45:02.267: DEBUG/dalvikvm(603): GC_CONCURRENT freed 102K, 69% free 322K/1024K, external 0K/0K, paused 4ms+1ms
03-31 17:45:02.289: DEBUG/jdwp(603): Got wake-up signal, bailing out of select
03-31 17:45:02.289: DEBUG/dalvikvm(603): Debugger has detached; object registry had 1 entries
03-31 17:45:03.208: WARN/ActivityThread(612): Application com.example.helloandroid is waiting for the debugger on port 8100...
03-31 17:45:03.288: INFO/System.out(612): Sending WAIT chunk
03-31 17:45:03.298: INFO/dalvikvm(612): Debugger is active
03-31 17:45:03.358: INFO/System.out(612): Debugger has connected
03-31 17:45:03.409: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:03.608: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:03.808: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.018: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.218: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.419: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.628: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:04.828: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.038: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.248: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.449: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.648: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:05.859: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:06.058: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:06.268: INFO/System.out(612): waiting for debugger to settle...
03-31 17:45:06.479: INFO/System.out(612): debugger has settled (1340)
03-31 17:45:12.150: WARN/ActivityManager(61): Launch timeout has expired, giving up wake lock!
03-31 17:45:13.158: WARN/ActivityManager(61): Activity idle timeout for HistoryRecord{40556f78 com.example.helloandroid/.HelloAndroid}
03-31 17:45:18.238: DEBUG/dalvikvm(239): GC_EXPLICIT freed 6K, 54% free 2543K/5511K, external 410K/517K, paused 53ms
03-31 17:45:23.369: DEBUG/dalvikvm(287): GC_EXPLICIT freed 9K, 54% free 2597K/5639K, external 410K/517K, paused 119ms
03-31 17:45:28.339: DEBUG/dalvikvm(329): GC_EXPLICIT freed <1K, 54% free 2539K/5511K, external 410K/517K, paused 51ms
03-31 17:45:33.409: DEBUG/dalvikvm(129): GC_EXPLICIT freed 76K, 51% free 2929K/5959K, external 1542K/1970K, paused 110ms
03-31 17:45:38.949: DEBUG/SntpClient(61): request time failed: java.net.SocketException: Address family not supported by protocol

and the app appears in the emulator without any of the items specified by main.xml, just the title bar. The breakpoint I set in ExtendedSeekBar::initialise is not encountered.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

西瑶 2024-11-05 06:19:36

您需要通过以下方式将视图添加到 xml 中:

<view class="com.example.helloandroid.ExtendedSeekBar"...

You need to add the view to the xml in the following way:

<view class="com.example.helloandroid.ExtendedSeekBar"...
鲜肉鲜肉永远不皱 2024-11-05 06:19:36

在 xml 中使用创建搜索栏

<com.example.helloandroid.ExtendedSeekBar

/>

in xml create seek bar using

<com.example.helloandroid.ExtendedSeekBar

/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文