-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain no
67 lines (64 loc) · 1.81 KB
/
train no
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.example.railpnr;
import android.R.string;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class TrainNumber extends Activity implements OnClickListener
{
AutoCompleteTextView trn;
Button go1;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_train_number);
trn=(AutoCompleteTextView)findViewById(R.id.jtno);
go1=(Button)findViewById(R.id.go2);
go1.setOnClickListener(this);
EveryString obj=new EveryString();
ArrayAdapter<String> adapt=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,obj.trainNums);
trn.setAdapter(adapt);
trn.setThreshold(1);
}
@Override
public void onClick(View v)
{
EveryFunC obj=new EveryFunC();
if((getIntent().getStringExtra("off")).equals("22"))
{
String abc=trn.getText().toString(),xyz="";;
for(int i=0;i<5;i++)
{
xyz+=String.valueOf(abc.charAt(i));
}
obj.broadcastsms("139", "TRNSH "+xyz,getApplicationContext());
}
if((getIntent().getStringExtra("off")).equals("11"))
{
if(obj.abcd(getApplicationContext()))
{
String abc=trn.getText().toString(),xyz="";;
for(int i=0;i<5;i++)
{
xyz+=String.valueOf(abc.charAt(i));
}
Intent i=new Intent(getApplicationContext(), DisplayScreen.class);
i.putExtra("train", xyz);
i.putExtra("counter", "2");
startActivity(i);
}
else
{
Toast.makeText(getApplicationContext(), "No Internet Connection", Toast.LENGTH_SHORT).show();
}
}
}
}