This is XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layout_root"
tools:context=".MainActivity">
<ImageView
android:id="@+id/image_layout"
android:layout_width="match_parent"
android:src="@android:drawable/btn_star_big_on"
android:layout_height="wrap_content"
android:layout_marginTop="109dp" />
</RelativeLayout>
This is MainActivity.class
public class MainActivity extends AppCompatActivity {
ImageView mImageView;
RelativeLayout mLayoutRoot;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageView = (ImageView) findViewById(R.id.image_layout);
mLayoutRoot = (RelativeLayout) findViewById(R.id.layout_root);
takeScreenAndLoadToImageView();
}
private void taleScreenAndLoadToImage{
// What must I do.
}
How to I can take current screen activity and load image to ImageView?
Please. Help me!