我正在开发一个音乐播放器应用程序 除应用程序突然死亡外,一切正常.有时这会在应用程序启动时发生,有时在运行很长时间后发生.有时一切顺利,没有应用程序死亡.我观察了日志,以了解造成应用程序死亡的原因,并发现:
11-02 16:39:39.293: A/libc(3556): @@@ ABORTING: INVALID HEAP ADDRESS IN dlfree
11-02 16:39:39.293: A/libc(3556): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
Run Code Online (Sandbox Code Playgroud)
下面给出了完整的日志,这是我在应用程序死亡时在logcat中找到的内容:
11-02 16:39:39.293: A/libc(3556): @@@ ABORTING: INVALID HEAP ADDRESS IN dlfree
11-02 16:39:39.293: A/libc(3556): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
11-02 16:39:39.793: I/DEBUG(3257): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-02 16:39:39.793: I/DEBUG(3257): Build fingerprint: 'Polaroid/nuclear_md7008/nuclear-md7008:4.0.4/IMM76D/20120929:eng/test-keys'
11-02 16:39:39.793: I/DEBUG(3257): pid: 3556, tid: 3556 >>> com.polaroid.kidsmusic <<<
11-02 16:39:39.793: …
Run Code Online (Sandbox Code Playgroud) 我有两个ImageButtons,每个都在RelativeLayout中,这两个RelativeLayout在另一个RelativeLayout中,我想为每个ImageButton设置TouchDelegate.如果通常我将TouchDelegate添加到每个ImageButton并且它的父RelativeLayout然后只有一个ImageButton正常工作,另一个不扩展它的点击区域.因此,PLease帮助我了解如何在两个ImageButtons中使用TouchDelegate.如果不可能,那么扩展视图点击区域的有效方法是什么?提前致谢 ........
这是我的xml代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/FrameContainer"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout android:layout_alignParentLeft="true"
android:id="@+id/relativeLayout3" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout android:layout_alignParentLeft="true"
android:id="@+id/relativeLayout1" android:layout_width="113dip"
android:layout_height="25dip">
<ImageButton android:id="@+id/tutorial1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:src="@drawable/tutorial" />
</RelativeLayout>
<RelativeLayout android:layout_alignParentLeft="true"
android:id="@+id/relativeLayout2" android:layout_width="113dip"
android:layout_height="25dip" android:layout_marginLeft="100dip">
<ImageButton android:id="@+id/tutorial2"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:src="@drawable/tutorial"
android:layout_marginLeft="50dip" />
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我的Activity类:
import android.app.Activity;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.TouchDelegate;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class TestTouchDelegate extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) …
Run Code Online (Sandbox Code Playgroud) 我想在使用媒体录制器录制视频时显示已过滤的相机预览.要过滤预览,我需要正常的帧,我可以从onPreviewFrame()函数获得,但在使用媒体记录器录制视频时,onPreviewFrame()函数不会被调用.所以我想知道的是,有没有其他方法可以让这些帧进行过滤,然后在修改后显示它们?我查看了Google Play中的一些应用,例如Videocam Illusion.它在录制视频时显示预览效果.我想做类似的事情,但没有提示如何这样做.所以我将非常感谢有关该问题的任何帮助/提示/代码/示例.谢谢.
我通过将文件转换为字节数组将图像文件从设备上传到 PHP 服务器。我正在我的应用程序中使用 android-async-http-1.3.1.jar 将文件上传到服务器。
http://loopj.com/android-async-http/
我想要的是在进度条上显示已上传字节数组的字节数。现在,问题是,我怎样才能知道在上传过程中上传了多少字节。在有关想法/示例/代码的问题上需要帮助。在此先感谢各位。
当按下按钮时,我希望我的活动视图淡出.我将动画代码放在按钮的OnClickListener()中,但淡出没有发生.所以任何想法如何在点击按钮时设法淡出当前活动的视图?提前致谢 .....
实际上,我的目的是,在我的应用程序中,当一个活动开始时,该活动的视图将淡入,当活动结束时,它的视图将淡出,然后新活动的视图将淡入.下面,我给我的代码,请帮助找出那里的问题.....
public class First extends Activity {
Animation slide;
View view;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
view = (View) findViewById(android.R.id.content);
slide = AnimationUtils.loadAnimation(this, R.anim.fade_in);
view.startAnimation(slide);
Button btn = (Button) findViewById(R.id.retour);
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(v.getContext(),Second.class);
slide = AnimationUtils.loadAnimation(First.this, R.anim.fade_out);
view.startAnimation(slide);
Test.group.replaceContentView("Second", intent, 0);
}
});
}
}
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用挪威语数据的android应用程序。现在,我必须按字母顺序对名称列表进行排序,其中名称包含特殊的挪威字符。
Comparator<SetGetMethods> comperator = new Comparator<SetGetMethods>() {
public int compare(SetGetMethods object1, SetGetMethods object2) {
return object1.getCityname().compareToIgnoreCase(object2.getCityname());
}
};
Collections.sort(temp, comperator);
Run Code Online (Sandbox Code Playgroud)
我使用上面的代码按字母顺序对列表进行排序。但是经过排序后,在顶部显示有普通字符的名称,在其下面显示有特殊挪威字符的名称。例如,列表显示如下,
Arendal Bergen DrammenÅlesund->(应放在最上面,排序后在Arendal之前)
所以,我的问题是,我如何按字母顺序对列表进行排序,其中列表数据包含特殊字符(挪威字符)。我将不胜感激任何建议,想法或示例代码来解决该问题。谢谢 .....
我想在更改ActivityGroup中的活动时添加幻灯片切换动画.我使用了以下函数来使用intent更改活动:
public void replaceContentView(String id, Intent newIntent) {
View view = getLocalActivityManager().startActivity(id,
newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
.getDecorView();
history.add(view);
this.setContentView(view);
}
Run Code Online (Sandbox Code Playgroud)
有什么建议怎么办?
android ×7
animation ×2
view ×2
bytearray ×1
camera ×1
fadeout ×1
frames ×1
heap-memory ×1
image ×1
imagebutton ×1
java ×1
layout ×1
live-preview ×1
progress-bar ×1
sorting ×1
string ×1
upload ×1