Android Studio development-UI interface mixed control using XML and Java code
package com.example.lhb.contentprovider1;import android.app.ActionBar;import android.app.Activity;import android.content.ContentResolver;import android.database.Cursor;import android.graphics.Color;import android.provider.ContactsContract;import android.support.v7.app.ActionBarActivity;import android.os.Bundle;import android.util.TypedValue;import android.view.Menu;import android.view.MenuItem;import android.view.ViewGroup;import android.widget.FrameLayout;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.TextView;public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); LinearLayout LL=(LinearLayout)findViewById(R.id.layout); ImageView []Img=new ImageView[4]; int []ImgSource=new int[]{ R.drawable.pic1,R.drawable.pic2,R.drawable.pic3,R.drawable.pic4 }; for(int i=0;i