2020-03-01 21:01:06
package com.xbsaykat.easy24admin.Market;
 
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
 
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
 
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.xbsaykat.easy24admin.R;
 
public class AddMarketerActivaty extends AppCompatActivity {
    EditText EdMarketerid,EdMarketername,EdMarketerphone;
    Button BtDone;
    DatabaseReference AddMarketerRef = FirebaseDatabase.getInstance().getReference().child("Marketers");
 
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.addmarketer);
 
        EdMarketerid=findViewById(R.id.marketerid);
        EdMarketername=findViewById(R.id.marketername);
        EdMarketerphone=findViewById(R.id.marketerphone);
 
        BtDone=findViewById(R.id.done);
 
        BtDone.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AddMarketerRef.child(EdMarketerid.getText().toString()).child("ID").setValue(EdMarketerid.getText().toString());
                AddMarketerRef.child(EdMarketerid.getText().toString()).child("Name").setValue(EdMarketername.getText().toString());
                AddMarketerRef.child(EdMarketerid.getText().toString()).child("Phone").setValue(EdMarketerphone.getText().toString());
                finish();
            }
        });
    }
}
 
Invalid Email or Password