Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Task #616215 » CameraFragment.txt

子琛 郝, 2016-11-29 02:48 AM

 
package com.example.administrator.missphoto;

import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;


public class CameraFragment extends Fragment {
private View view;
private Context context;
private ImageView IvCameraHeadportrait;

@Nullable

public void setContext(Context context) {
this.context = context;
}

@Override
public Context getContext() {
return context;
}


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

view = inflater.inflate(R.layout.layout_camera, container, false);
return view;
}

@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
IvCameraHeadportrait=(ImageView)view.findViewById(R.id.IvCameraHeadportrait);
IvCameraHeadportrait.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(getActivity(), EntryActivity.class);
startActivity(intent);
}
});
}
}
(1-1/4)