Monday, 20 May 2013

Different result of the Application between Android Emulator and Android Phone

Different result of the Application between Android Emulator and Android Phone

I need a help with this Android application! I'm at very beginning in developing on Android and for a school's project I have to create an App that scan qr's codes and shoot photo.
I don't own an Android phone so I'm using the Android emulator to test everything. Everything is fine, my app take a photo through an intent and put it in an ItemsAdapter, that I show it with other Item (QR result and Photos) with "Pinterest" view style. My problem is that on the Android emulator everything is fine, instead on Android phone that I borrow from schoolmates the photos are not showing as preview in the Story fragment and inside the ItemInfo intent that I call with onClickListener.
I tried to explain the whole operation, feel free to ask me everything you need that may help you to help me :)
public class Story extends Fragment {

public static int id_mostra;
public static boolean start = true;
int removable;

public static Button send;
private StaggeredGridView pinterest;
public static ItemsAdapter pinterestAdapter;
public static RelativeLayout buttonLayout;
public static ImageView tutorial;

private View sView;


Item oggetto;


public Story(){


}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {



    sView = inflater.inflate(R.layout.activity_story, container, false);
    pinterest = (StaggeredGridView) sView.findViewById(R.id.staggeredGridView);
    send = (Button) sView.findViewById(R.id.send_button);
    Story.send.setVisibility(View.INVISIBLE);

    buttonLayout = (RelativeLayout) sView.findViewById(R.id.buttonLine);

    tutorial = (ImageView) sView.findViewById(R.id.tutorial);

    pinterest.setOnItemClickListener(onItemClick);
    pinterest.setOnItemLongClickListener(longListener);

    send.setText("Send story");

    send.setOnClickListener(sendListener);

    loadItems();


    return sView;
}

//on click listener (accessing object infos)
    StaggeredGridView.OnItemClickListener onItemClick = new StaggeredGridView.OnItemClickListener(){

        @Override
        public void onItemClick(StaggeredGridView parent, View view, int position, long id) {

            oggetto=PageViewer.values.get(position);

            if (oggetto.type=="QR"){
                Intent info = new Intent(PageViewer.getAppContext(), ItemInfo.class);
                info.putExtra("pos", position);
                startActivity(info);
            }
            else{

                Intent info = new Intent(PageViewer.getAppContext(), FotoInfo.class);
                info.putExtra("pos", position);
                startActivity(info);
            }
        }



    };








public class FotoInfo extends Activity {

TextView title;
ImageView v;
int pos;
Item item;
ImageDownloader downloader;
Bitmap bitmap;

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_foto_info);
    Bundle b = getIntent().getExtras();
    pos = b.getInt("pos");

    item = new Item();

    v = new ImageView(this);
    try{
        item = PageViewer.values.get(pos);
    }
    catch (Except

No comments:

Post a Comment