Android pdf转换

时间:2016-08-25 11:33:32

标签: android

我正在尝试输入数据并将其显示在新活动中,该活动已完成并且已粉碎。但是,我想将我的DispalyActivity转换为pdf格式,以便可以作为邮件发送。 我无法将其转换为pdf。 Plz help.Thank你!! 这是我的DispalyActivity代码..

public class DisplayActivity extends AppCompatActivity {
//ITC RESOURCES..**
Button button_back;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_display);
    button_back = (Button) findViewById(R.id.button_bck);

    //this.getActionBar().hide();
    Bundle bundle = getIntent().getExtras();

    //get the values out by key
    String name=bundle.getString("name");
    String rep=bundle.getString("rep");
    String rfq=bundle.getString("rfq");
    String vec_no=bundle.getString("ProdType");
    String vec_type=bundle.getString("Item");
    //String date=bundle.getString("date");
   // String time=bundle.getString("time");
    String facility1=bundle.getString("spinner1");
    String facility2=bundle.getString("spinner2");
    String facility3=bundle.getString("spinner3");
    String findings=bundle.getString("findings");
    String status_label=bundle.getString("status_label");
    String more_info=bundle.getString("more_info");
    String corrective_action=bundle.getString("corrective_action");

    TextView name1 = (TextView) findViewById(R.id.ET1);
    TextView rep1 = (TextView) findViewById(R.id.ET2);
    TextView rfq1 = (TextView) findViewById(R.id.ET3);
    TextView ProdType1 = (TextView) findViewById(R.id.ET4);
    TextView Item1 = (TextView) findViewById(R.id.ET5);

    TextView facility11 = (TextView) findViewById(R.id.ET8);
    TextView facility21 = (TextView) findViewById(R.id.ET9);
    TextView facility31 = (TextView) findViewById(R.id.ET10);
    TextView findings1 = (TextView) findViewById(R.id.ET11);
    TextView status_label1 = (TextView) findViewById(R.id.ET12);
    TextView more_info1 = (TextView) findViewById(R.id.ET13);
    TextView corrective_action1 = (TextView) findViewById(R.id.ET14);

   /* name.setText(b.getCharSequence("name"));
    rep.setText(b.getCharSequence("rep"));
    rfq.setText(b.getCharSequence("rfq"));
    vec_no.setText(b.getCharSequence("vec_no"));
    vec_type.setText(b.getCharSequence("vec_type"));
    date.setText(b.getCharSequence("date"));
    time.setText(b.getCharSequence("time"));

    facility1.setText(b.getCharSequence("facility1"));
    facility2.setText(b.getCharSequence("facility2"));
    facility3.setText(b.getCharSequence("facility3"));     

    findings.setText(b.getCharSequence("findings"));
    status_label.setText(b.getCharSequence("status_label"));
    more_info.setText(b.getCharSequence("more_info"));
    corrective_action.setText(b.getCharSequence("corrective_action"));*/

    //set the text values of the text controls
    name1.setText(name);
    rep1.setText(rep);
    rfq1.setText(rfq);
    ProdType1.setText(vec_no);
    Item1.setText(vec_type);

    facility11.setText(facility1);
    facility21.setText(facility2);
    facility31.setText(facility3);
    findings1.setText(findings);
    status_label1.setText(status_label);
    more_info1.setText(more_info);
    corrective_action1.setText(corrective_action);

        }
  public void moveTOmain(View view)
   {
    Intent intent = new Intent(DisplayActivity.this, MainActivity.class);
    startActivity(intent);
    }
   }

0 个答案:

没有答案