2016-04-28 5 views
1

でメールにそれを送る。..はポップアップvalusを取得し、私はフォームの値を持つアプリを持っているアンドロイド

タイトル... 名... メール... 送信(ボタン) と、このフォームがポップアップウィンドウとして表示され 私のポップアップXMLコードは、まず

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
android:id="@+id/compose_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="#C0000000" 
android:visibility="visible" 
android:gravity="center" 
xmlns:android="http://schemas.android.com/apk/res/android"> 

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="wrap_content" 
     android:id="@+id/popup" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:background="#f47d7d" 
     android:layout_gravity="center" 
     android:paddingLeft="20sp" 
     android:paddingRight="60sp" 
     android:paddingTop="20sp" 
     android:paddingBottom="20sp" 
     > 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Popup" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 


     <EditText 
      android:id="@+id/topicname" 
      android:layout_marginTop="5dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:hint="Topic Name" /> 

     <EditText 
      android:id="@+id/topiccontent" 
      android:layout_marginTop="5dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:hint="Topic Headings" /> 
     <EditText 
      android:id="@+id/usermail" 
      android:layout_marginTop="5dp" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:hint="Enter your mail" /> 

     <Button 
      android:id="@+id/close" 
      android:layout_marginTop="10dp" 
      android:layout_gravity="" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Send" /> 

    </LinearLayout> 
</RelativeLayout> 

で、私のポップアップウィンドウのフォームがeditable..pleaseされていないが は第二に、私はこれらの値を取得したい、それが編集可能にするために何かを示唆して(タイトル、ユーザー名電子メール)を送信し、指定された電子メールアドレスに送信します終了ボタンをクリックします。事前

+0

ない編集可能な手段は、あなたがテキストを入力することができませんか? – Haroon

+0

はい...それはポップアップでは編集できませんが、私の主な活動でedittextの同じコードを使用していれば...私のproblmのために何か提案してください@Haroon – Manpreet

+0

ダイアログフラグメントを使用できますか?同じ? – Haroon

答えて

0
BackgroundMail.newBuilder(getActivity()) 
        .withUsername("Your newly created Gmail account") 
        .withPassword("your password") 
        .withMailto(email.getText().toString()) 
        .withSubject("TEST ANDROID STUDIO") 
        .withBody("ELOWWWWW") 
        .withOnSuccessCallback(new BackgroundMail.OnSuccessCallback() { 
         @Override 
         public void onSuccess() { 
          //do some magic 
          Log.d(TAG,"MAI SENDED"); 
         } 
        }) 
        .withOnFailCallback(new BackgroundMail.OnFailCallback()  { 
         @Override 
         public void onFail() { 
          Log.d(TAG,"MAI FAILED"); 
         } 
        }) 
        .send(); 

で おかげでモジュールとしてライブラリをインポートするためにあなたの送信ボタンをclicklistner 内で上記のメソッドを呼び出し、このリンクからそれを得るhttps://github.com/yesidlazaro/GmailBackground

関連する問題