我Service
在我的应用程序中使用它需要运行,直到我的应用程序被卸载,但问题是它被操作系统杀死.
我们怎样才能防止它被操作系统杀死?或者,如果它被杀死,我们可以通过编程方式再次重启该服务吗?
我在SD 卡上的特定目录中有一些音频文件。我需要在 Android 的列表视图中显示他们的名字,如果我想播放或删除该特定文件,我可以通过该列表视图执行此操作吗?我该怎么做?
public class MyPerformanceArrayAdapter extends ArrayAdapter<String> {
private final Context context;
private final String[] values;
public MyPerformanceArrayAdapter(Context context, String[] values) {
super(context, R.layout.main, values);
this.context = context;
this.values = values;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.main, parent, false);
TextView textView = (TextView) rowView.findViewById(R.id.label);
ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
textView.setText(values[position]);
// Change the icon for Windows and iPhone
String s = …
Run Code Online (Sandbox Code Playgroud) 我已将我的图像保存在res/drawable
文件夹中,但它仍然在控制台上给我这个错误
[2012-04-28 18:36:46 - Local] libpng error: Not a PNG file
[2012-04-28 18:36:46 - Local] ERROR: Failure processing PNG image D:\Android2_worksapce\Local\res\drawable-ldpi\ic_launcher.png
[2012-04-28 18:36:46 - Local] libpng error: Not a PNG file
[2012-04-28 18:36:46 - Local] ERROR: Failure processing PNG image D:\Android2_worksapce\Local\res\drawable-mdpi\ic_launcher.png
[2012-04-28 18:36:46 - Local] D:\Android2_worksapce\Local\res\layout\aboutus.xml:2: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/about').
[2012-04-28 18:36:46 - Local] D:\Android2_worksapce\Local\res\layout\autofare.xml:2: error: Error: No resource found that matches the given name (at 'background' …
Run Code Online (Sandbox Code Playgroud)