Android:从xml中的其他Textview创建Dynamic Textview和Copy Textview属性

时间:2014-12-14 03:52:29

标签: java android xml android-layout android-activity

您好我只是想创建动态多文本视图,我想从其他活动xml 复制textview属性。即我想复制所有形状,textview backgroupcolor,我为xml中的其他textview创建的渐变..请帮我解决这个问题

    public class MainActivity extends ActionBarActivity 
    {
    HorizontalScrollView v_Hor_scroll;
    LinearLayout v_hor_linear;
        @SuppressLint("NewApi")
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            v_Hor_scroll = (HorizontalScrollView) findViewById(R.id.xml_id_horizontalScrollView1);
            Uri uri = Telephony.Sms.CONTENT_URI;
            ContentResolver x_var_cont_inbox = this.getContentResolver();
            Cursor x_var_cur_inbox = x_var_cont_inbox.query(uri, new String[] {"DISTINCT ADDRESS"}, null, null, Telephony.Sms.DATE +" DESC");
            while(x_var_cur_inbox.moveToNext())
            {
                String v_mess_address = x_var_cur_inbox.getString(x_var_cur_inbox.getColumnIndex("ADDRESS"));
                TextView v_tv_mess_address = new TextView(this);
                v_tv_mess_address.setText(v_mess_address);
                v_hor_linear.addView(v_tv_mess_address);
            }

        }

    }

在为下面的行创建对象时,在此代码中,我还想从其他xml复制textview属性。是否有可能实现这一目标

TextView v_tv_mess_address = new TextView(this);

0 个答案:

没有答案