简体   繁体   中英

App error by pressing Home Button

I developed an app and now, since I am almost finished, I am in the process of fixing bugs and polishing it. At the moment I have the problem that whenever I press the home button it displays whatever was on the screen at that time as my homescreen wallpaper. I have no idea what causes this or how to get rid of it and that's what I need your help for.

Edit

Now i found the reason it is in my GridView. I don't no why it replace my wallpaper on this position, please help me.

Here the code example where i fill the adapter.

c = myDB.rawQuery(sql, null);

        getActivity().startManagingCursor(c);

        adapter = new SimpleCursorAdapter(getActivity().getBaseContext(), R.layout.grid_item, c,
                new String[]{"_id", "name", "thumb_image"}, new int[]{
                R.id.device, R.id.picture}, 0);

        adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
            @Override
            public boolean setViewValue(View view, Cursor theCursor,
                                        int column) {
                int id = view.getId();
                if (id == R.id.device) {
                    final String name = theCursor.getString(1);
                    ((TextView) view).setText(name);
                    return true;
                } else if (id == R.id.picture) {
                    Context context = ((ImageView) view).getContext();
                    int pic_id = context.getResources().getIdentifier(theCursor.getString(2), "drawable", context.getPackageName());
                    ((ImageView) view).setImageResource(pic_id);
                    return true;
                }

                return false;
            }
        });

        gridView.setAdapter(adapter);

通过按家庭壁纸被替换

我自己解决的问题是一个动画文件:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM