Stream API in twitter Not responding - java

I am using twitter4j Stream API 3.0.3 jar. I tried to get the User Stream and tweets my code is given below. It is running only not showing any outputs for past 1 hour.
public class StreamAPI {
public static void main(String[] args) {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true);
cb.setOAuthConsumerKey("xxxx");
cb.setOAuthConsumerSecret("xxxx");
cb.setOAuthAccessToken("xxx-x");
cb.setOAuthAccessTokenSecret("xxxxx");
cb.setUseSSL(true);
TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();
RawStreamListener listener = new RawStreamListener() {
#Override
public void onMessage(String rawJSON) {
System.out.println(rawJSON);
}
#Override
public void onException(Exception ex) {
ex.printStackTrace();
}
};
twitterStream.addListener(listener);
twitterStream.sample();
}
}
and when I try to get user, it shows 401 Authentication error
static UserStreamListener listener = new UserStreamListener() {
#Override
public void onStatus(Status status) {
System.out.println("onStatus #" + status.getUser().getScreenName() + " - " + status.getText());
}
#Override
public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {
System.out.println("Got a status deletion notice id:" + statusDeletionNotice.getStatusId());
}
#Override
public void onDeletionNotice(long directMessageId, long userId) {
System.out.println("Got a direct message deletion notice id:" + directMessageId);
}
#Override
public void onTrackLimitationNotice(int numberOfLimitedStatuses) {
System.out.println("Got a track limitation notice:" + numberOfLimitedStatuses);
}
#Override
public void onScrubGeo(long userId, long upToStatusId) {
System.out.println("Got scrub_geo event userId:" + userId + " upToStatusId:" + upToStatusId);
}
#Override
public void onStallWarning(StallWarning warning) {
System.out.println("Got stall warning:" + warning);
}
#Override
public void onFriendList(long[] friendIds) {
System.out.print("onFriendList");
for (long friendId : friendIds) {
System.out.print(" " + friendId);
}
System.out.println();
}
#Override
public void onFavorite(User source, User target, Status favoritedStatus) {
System.out.println("onFavorite source:#"
+ source.getScreenName() + " target:#"
+ target.getScreenName() + " #"
+ favoritedStatus.getUser().getScreenName() + " - "
+ favoritedStatus.getText());
}
#Override
public void onUnfavorite(User source, User target, Status unfavoritedStatus) {
System.out.println("onUnFavorite source:#"
+ source.getScreenName() + " target:#"
+ target.getScreenName() + " #"
+ unfavoritedStatus.getUser().getScreenName()
+ " - " + unfavoritedStatus.getText());
}
#Override
public void onFollow(User source, User followedUser) {
System.out.println("onFollow source:#"
+ source.getScreenName() + " target:#"
+ followedUser.getScreenName());
}
#Override
public void onDirectMessage(DirectMessage directMessage) {
System.out.println("onDirectMessage text:"
+ directMessage.getText());
}
#Override
public void onUserListMemberAddition(User addedMember, User listOwner, UserList list) {
System.out.println("onUserListMemberAddition added member:#"
+ addedMember.getScreenName()
+ " listOwner:#" + listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserListMemberDeletion(User deletedMember, User listOwner, UserList list) {
System.out.println("onUserListMemberDeleted deleted member:#"
+ deletedMember.getScreenName()
+ " listOwner:#" + listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserListSubscription(User subscriber, User listOwner, UserList list) {
System.out.println("onUserListSubscribed subscriber:#"
+ subscriber.getScreenName()
+ " listOwner:#" + listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserListUnsubscription(User subscriber, User listOwner, UserList list) {
System.out.println("onUserListUnsubscribed subscriber:#"
+ subscriber.getScreenName()
+ " listOwner:#" + listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserListCreation(User listOwner, UserList list) {
System.out.println("onUserListCreated listOwner:#"
+ listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserListUpdate(User listOwner, UserList list) {
System.out.println("onUserListUpdated listOwner:#"
+ listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserListDeletion(User listOwner, UserList list) {
System.out.println("onUserListDestroyed listOwner:#"
+ listOwner.getScreenName()
+ " list:" + list.getName());
}
#Override
public void onUserProfileUpdate(User updatedUser) {
System.out.println("onUserProfileUpdated user:#" + updatedUser.getScreenName());
}
#Override
public void onBlock(User source, User blockedUser) {
System.out.println("onBlock source:#" + source.getScreenName()
+ " target:#" + blockedUser.getScreenName());
}
#Override
public void onUnblock(User source, User unblockedUser) {
System.out.println("onUnblock source:#" + source.getScreenName()
+ " target:#" + unblockedUser.getScreenName());
}
#Override
public void onException(Exception ex) {
ex.printStackTrace();
System.out.println("onException:" + ex.getMessage());
}
};
Is anyone can help me to get details about the user, users followers following and tweets in Twitter

The 401 error code indicates that you're not properly authenticated. Are you certain those credentials are correct?
A good way to test that would be to connect to the regular streaming API (rather than a user stream) and seeing if you still get a 401. If you do, then your credentials are incorrect. If it works, then there's a problem with the user stream you're requesting.

Related

connection with Facebook OK, But I lost data when i came back on MainActivity

I'm going to develop an android application, and I'm trying to separate things .... I have created a FacebookConnect class to call facebook API to retrieve facebook public information to use them later but my object is null when i came back to my main Java class.
Any idea...my knowledge is average in this field of skills.
This is my function in FacebookConnect
public void getConnectionWithFacebook(Activity myActivity, CallbackManager mCallbackManager){
MCALLBACKMANAGER = mCallbackManager;
MYACTIVITY = myActivity;
ONEUSER = new User();
LoginManager.getInstance().logInWithReadPermissions(MYACTIVITY, Arrays.asList("email", "public_profile"));
LoginManager.getInstance().registerCallback(MCALLBACKMANAGER, new FacebookCallback<LoginResult>() {
#Override
public void onSuccess(LoginResult loginResult) {
Log.d(TAG,"facebookSuccess3 -> " + loginResult.toString());
// App code
GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
#Override
public void onCompleted(JSONObject object, GraphResponse response) {
Log.d(TAG,"facebookSuccess4 -> " + response.toString());
getDataFromFacebook(object);
}
});
Bundle parameters = new Bundle();
parameters.putString("fields","id,email,first_name,last_name");
request.setParameters(parameters);
request.executeAsync();
}
#Override
public void onCancel() {
Log.d(TAG,"facebook -> " + "onCancel");
Toast.makeText(MYACTIVITY, "Une erreur s'est produite, veuillez réessayer plus tard...", Toast.LENGTH_LONG).show();
}
#Override
public void onError(FacebookException error) {
Log.d(TAG,"facebookONError -> " +error.toString());
Toast.makeText(MYACTIVITY, "Une erreur s'est produite, veuillez réessayer plus tard...", Toast.LENGTH_LONG).show();
// ...
}
});
}
In my main class , i will call this function inside of this event of click :
btnFBLogin.setOnClickListener(new View.OnClickListener() {
FacebookConnect oneConnection = new FacebookConnect();
#Override
public void onClick(View v) {
btnFBLogin.setEnabled(false);
oneConnection.getConnectionWithFacebook(MainActivity.this, mCallbackManager);
String email = oneConnection.getEmail();
Log.d(TAG,"handleFacebookToken1 -> " + email); // doesnt work
}
});
Unfortunately, the result is null or empty and I don't know why.
Edit :
This is my function to associate data from facebook to my class :
public void getDataFromFacebook(JSONObject object) {
try{
String emailJSON = object.getString("email");
String fristNameJSON = object.getString("first_name");
String lastNameJSON = object.getString("last_name");
Log.d(TAGUSER,"facebookSuccess -> " + emailJSON);
Log.d(TAGUSER,"facebookSuccess -> " + fristNameJSON);
Log.d(TAGUSER,"facebookSuccess -> " + lastNameJSON);
//Log.d(TAGUSER,"facebookSuccess -> " + object.getString("email"));
// Log.d(TAGUSER,"facebookSuccess -> " + object.getString("first_name"));
//Log.d(TAGUSER,"facebookSuccess -> " + object.getString("last_name"));
this.setEmail(emailJSON);
this.setFirstName(fristNameJSON);
this.setLastName(lastNameJSON);
Log.d(TAGUSER,"facebookSuccess -> " + getEmail());
Log.d(TAGUSER,"facebookSuccess -> " + getFirstName());
Log.d(TAGUSER,"facebookSuccess -> " + getLastName());
} catch (JSONException e) {
e.printStackTrace();
}
}
I put a lot of lot every where to see what happens with de data
Thx again !

array list adds the elements then remove them alone

I am using arrayList of object in my app. I made a methods to check if an element exists in the list or no. The element is coming from firebase database. After adding these methods I found that the elements appears in the recycler view then disappears again. I debugged my code and I found that the elements are added to the list then removed again, but I can't understand why this behavior happens.
These are the methods I made :
boolean existsInCompletedChallengesList(String currentChallengeId) {
for (Challenge c : completedChallengesList) {
Log.v("completedChallengesList", "id of challenge in completedChallengesList : " + c.getId() + " current challengeId " + currentChallengeId);
if (c.getId().equals(currentChallengeId)) {
return true;
}
}
return false;
}
boolean existsInUncompletedChallengesList(String currentChallengeId) {
no++;
Log.v("check", "number of times is : " + no);
for (Challenge c : uncompletedChallengesList) {
Log.v("uncompletedChallengesLi", "id of challenge in uncompletedChallengesList : " + c.getId() + " current challengeId " + currentChallengeId);
if (c.getId().equals(currentChallengeId)) {
Log.v("uncompletedChallengesLi", "id of challenge in uncompletedChallengesList : " + c.getId() + " returned true" + currentChallengeId);
return true;
}
}
Log.v("uncompletedChallengesLi", "returned false" );
return false;
}
and this is the code that brings the data from the firebase database :
public void startAsynkTask() {
//TODO : search for a solution to this error
AsyncTask asyncTask = new AsyncTask() {
#Override
protected Boolean doInBackground(Object[] objects) {
try {
Socket sock = new Socket();
sock.connect(new InetSocketAddress("8.8.8.8", 53), 1500);
sock.close();
return true;
} catch (IOException e) {
return false;
}
}
#Override
protected void onPostExecute(Object o) {
if ((boolean) o) {
clearLists();
ChildEventListener generalChallengesListener = new ChildEventListener() {
#Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
Log.v("onChildAdded", "child added");
getChallengeData(dataSnapshot, "onChildAdded");
view.onDataFound();
}
#Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
//TODO : note that the only changing handled is when challenge moves from uncompleted to completed state
if(!dataSnapshot.getKey().equals("questionsList")){
getChallengeData(dataSnapshot, "onChildChanged");
}
for (int i = 0; i < uncompletedChallengesList.size(); i++) {
if (uncompletedChallengesList.get(i).getId().equals(dataSnapshot.getKey())) {
uncompletedChallengesList.remove(i);
view.notifyAdapters(completedChallengesList.size(), uncompletedChallengesList.size());
break;
}
}
checkListsSizeAndAdjustViews();
view.hideProgressBar();
}
#Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
startAsynkTask();
}
#Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
#Override
public void onCancelled(DatabaseError databaseError) {
//Toast.makeText(getActivity(), "فشل تحميل البيانات من فضلك تأكد من الاتصال بالانترنت", Toast.LENGTH_SHORT).show();
view.hideProgressBar();
Log.v("Logging", "error loading data : " + databaseError);
}
};
//this code gives data where current user is player 1
player1Listener = challengesReference.orderByChild("player1Uid").equalTo(currentUserUid).addChildEventListener(generalChallengesListener);
//this code gives data where current user is player 2
player2Listener = challengesReference.orderByChild("player2Uid").equalTo(currentUserUid).addChildEventListener(generalChallengesListener);
challengesReference.addListenerForSingleValueEvent(new ValueEventListener() {
#Override
public void onDataChange(DataSnapshot dataSnapshot) {
onInitialDataLoaded();
Log.v("ChallengesFragPresenter", "completed list size :" + completedChallengesList + " , uncompleted list size : " + uncompletedChallengesList);
challengesReference.removeEventListener(this);
}
#Override
public void onCancelled(DatabaseError databaseError) {
}
});
} else {
view.onNoInternetConnection();
}
}
};
asyncTask.execute();
}
public String getChallengeData(DataSnapshot dataSnapshot, String tag) {
Log.v("ChallengesFragPresenter", "get challenge data called");
Log.v("ChallengesFragPresenter", "completedChallengesList : " + completedChallengesList.size()
+ ", uncompletedChallengesList " + uncompletedChallengesList.size());
view.startCompletedChallengesAdapter(completedChallengesList);
view.startUnCompletedChallengesAdapter(uncompletedChallengesList);
GenericTypeIndicator<List<Question>> t = new GenericTypeIndicator<List<Question>>() {
};
challenge = new Challenge();
String challengeDate = dataSnapshot.child("date").getValue().toString();
String challengeSubject = dataSnapshot.child("subject").getValue().toString();
String challengeState = dataSnapshot.child("state").getValue().toString();
String challengeId = dataSnapshot.getKey();
ArrayList challengeQuestionsList = (ArrayList) dataSnapshot.child("questionsList").getValue(t);
long player1Score = (long) dataSnapshot.child("player1score").getValue();
long player2Score = (long) dataSnapshot.child("player2score").getValue();
String player1Name = dataSnapshot.child("player1Name").getValue().toString();
String player1Image = dataSnapshot.child("player1Image").getValue().toString();
String player1Uid = dataSnapshot.child("player1Uid").getValue().toString();
String player2Name = dataSnapshot.child("player2Name").getValue().toString();
String player2Image = dataSnapshot.child("player2Image").getValue().toString();
String player2Uid = dataSnapshot.child("player2Uid").getValue().toString();
String challengerName, challengerImage;
if (player1Uid.equals(currentUserUid)) {
currentPlayer = 1;
challengerName = player2Name;
challengerImage = player2Image;
challenge.setSecondChallengerUid(player2Uid);//second means that it is not the player who starts the challenge
if (tag.equals("onChildAdded")) {
player1childrenCount++;
}
} else {
currentPlayer = 2;
challengerName = player1Name;
challengerImage = player1Image;
challenge.setSecondChallengerUid(player1Uid);//second means that it is not the player who starts the challenge
if (tag.equals("onChildAdded")) {
player2childrenCount++;
}
}
challenge.setCurrentPlayer(currentPlayer);
challenge.setChallengerName(challengerName);
challenge.setDate(challengeDate);
challenge.setImage(challengerImage);
challenge.setSubject(challengeSubject);
challenge.setState(challengeState);
challenge.setId(challengeId);
challenge.setPlayer1Score(player1Score);
challenge.setPlayer2Score(player2Score);
challenge.setQuestionsList(challengeQuestionsList);
String score;
if (currentPlayer == 1) {
score = player1Score + " : " + player2Score;
} else {
score = player2Score + " : " + player1Score;
}
challenge.setScore(score);
if (challenge.getState().equals("اكتمل")) {
Log.v("loggingC1", "value is " + !existsInCompletedChallengesList(challengeId));
if (!existsInCompletedChallengesList(dataSnapshot.getKey())) {
view.showCompletedChallengesTv();
completedChallengesList.add(0, challenge);
view.notifyAdapters(completedChallengesList.size(), uncompletedChallengesList.size());
}
}
else if (challenge.getState().equals(refusedChallengeText)) {
Log.v("loggingC2", "value is " + !existsInCompletedChallengesList(challengeId));
if (!existsInCompletedChallengesList(dataSnapshot.getKey())) {
view.showCompletedChallengesTv();
completedChallengesList.add(0, challenge);
view.notifyAdapters(completedChallengesList.size(), uncompletedChallengesList.size());
}
}
else if (challenge.getState().equals(uncompletedChallengeText)) {
Log.v("loggingC3", "value is " + !existsInUncompletedChallengesList(dataSnapshot.getKey()));
if (!existsInUncompletedChallengesList(challengeId)) {
view.showUncompletedChallengesTv();
uncompletedChallengesList.add(0, challenge);
view.notifyAdapters(completedChallengesList.size(), uncompletedChallengesList.size());
}
}
return player1Uid;
}
private void checkListsSizeAndAdjustViews() {
if (uncompletedChallengesList.size() == 0) {
view.hideUncompletedChallengesTv();
} else {
view.showUncompletedChallengesTv();
}
if (completedChallengesList.size() == 0) {
view.hideCompletedChallengesTv();
} else {
view.showCompletedChallengesTv();
}
if (completedChallengesList.size() == 0 && uncompletedChallengesList.size() == 0)
view.showNoChallengesTv();
else {
view.hideNoChallengesTv();
}
}
I am using asynk task at the begging to check if there is internet connection or no

Calling a public Class in onClick

I have an onClick event:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mPrayerTime = (Button)findViewById(R.id.muteButton);
mPrayerTime.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
//call CityModelHere
}
});
and I want to call this class (and specifically get the fajr variable without it returning null as it does if I instantiate a new cityModel in the onClick):
public class cityModel implements Serializable {
private String fajr;
public void setFajr(String fajr) {
this.fajr= fajr;
}
public String getFajr() {
return fajr;
}
}
the class takes the string from a later class here just in case:
protected void outputTimings(JSONArray jsonArray) {
String[] prayers = {"fajr", "shurooq", "dhuhr", "asr", "maghrib", "isha"};
cityModel cityObj;
try {
cityObj= new cityModel();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject cityObject =
jsonArray.getJSONObject(i);
result = result + "fajr" + " : "
+ cityObject.getString("fajr") + "\n" + result + "shurooq" + " : "
+ cityObject.getString("shurooq") + "\n" + result + "dhuhr" + " : "
+ cityObject.getString("dhuhr") + "\n" + result + "asr" + " : "
+ cityObject.getString("asr") + "\n" + result + "maghrib" + " : "
+ cityObject.getString("maghrib") + "\n" + result + "isha" + " : "
+ cityObject.getString("isha") + "\n";
cityObj.setFajr(""+cityObject.getString("fajr"));
}
} catch (JSONException e1) {
e1.printStackTrace();
}
}
Make your variable final, and then you can access it from the setOnClickListener.

How to call a Method in OnClickListener without variable (Fajr) in the method becoming null when called

In my OnClickListener:
private Button mPrayerTime;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mPrayerTime = (Button)findViewById(R.id.muteButton);
mPrayerTime.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
cityModel cityObj= new cityModel();
String fajr=cityObj.getFajr();
Log.d("Fajr", ""+fajr);
}
});
}
I call a method called cityModel, found here
public final class cityModel implements Serializable {
private String fajr;
public void setFajr(String fajr) {
this.fajr= fajr;
}
public String getFajr() {
return fajr;
}
}
which retrieves set.Fajr from:
protected void outputTimings(JSONArray jsonArray) {
String[] prayers = {"fajr", "shurooq", "dhuhr", "asr", "maghrib", "isha"};
final cityModel cityObj;
try {
cityObj= new cityModel();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject cityObject =
jsonArray.getJSONObject(i);
result = result + "fajr" + " : "
+ cityObject.getString("fajr") + "\n" + result + "shurooq" + " : "
+ cityObject.getString("shurooq") + "\n" + result + "dhuhr" + " : "
+ cityObject.getString("dhuhr") + "\n" + result + "asr" + " : "
+ cityObject.getString("asr") + "\n" + result + "maghrib" + " : "
+ cityObject.getString("maghrib") + "\n" + result + "isha" + " : "
+ cityObject.getString("isha") + "\n";
cityObj.setFajr(""+cityObject.getString("fajr"));
}
When I tried to debug, I found that cityModel finds the value for fajr and stores it just fine, so the issue seems to be with how I call the method because whenever I look for the label Fajr in logcat it shows up as null.

Save user input string to variable on button click

in my application the user will input a channel they want to subscribe to in an editable text field. Upon clicking the subscribe button, the variable that is placed in my method to subscribe the user should be updated to that of the users choice and then a toast will appear notifying the user that they are subscribed to this channel.
At the bottom, I get the string value that the user inputs in the EditText field, but I don't think I'm putting it in the right place. Can someone take a look at it and let me know what I'm doing wrong? Let me know if I wasn't clear or am missing something and I can try to explain better. Thanks!
public class MainActivity extends ActionBarActivity {
private Button channelSubscribeButton;
private EditText subscribeChannelEditText;
//Declare variable
String subscribeChannel = null;
//-------------------------Access PubNub API-------------------------//
Pubnub pubnub = new Pubnub("pub-c-940c4776-36ff-425f-9677-f1c904a9d57b", "sub-c-cf42b292-a8bf-11e4-85d5-0619f8945a4f");
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
channelSubscribeButton = (Button) findViewById(R.id.subscribe_button);
subscribeChannelEditText = (EditText) findViewById(R.id.channel_name);
//-------------------------Subscribe to a Channel to Receive Messages-------------------------//
try {
//THIS IS WHERE I AM INPUTTING THE VARIABLE THAT CONTAINS THE USER INPUTTED TEXT//
//I AM GETTING ERROR THAT SAYS IT CAN'T RESOLVE THE SYMBOL 'subscribeChannel'//
pubnub.subscribe(subscribeChannel, new Callback() {
#Override
public void connectCallback(String channel, Object message) {
Log.d("PUBNUB", "SUBSCRIBE : CONNECT on channel:" + channel
+ " : " + message.getClass() + " : "
+ message.toString());
}
#Override
public void disconnectCallback(String channel, Object message) {
Log.d("PUBNUB", "SUBSCRIBE : DISCONNECT on channel:" + channel
+ " : " + message.getClass() + " : "
+ message.toString());
}
public void reconnectCallback(String channel, Object message) {
Log.d("PUBNUB", "SUBSCRIBE : RECONNECT on channel:" + channel
+ " : " + message.getClass() + " : "
+ message.toString());
}
#Override
public void successCallback(String channel, Object message) {
Log.d("PUBNUB", "SUBSCRIBE : " + channel + " : "
+ message.getClass() + " : " + message.toString());
}
#Override
public void errorCallback(String channel, PubnubError error) {
Log.d("PUBNUB", "SUBSCRIBE : ERROR on channel " + channel
+ " : " + error.toString());
}
}
);
} catch (PubnubException e) {
Log.d("PUBNUB", e.toString());
}
public void onChannelButtonClick(View view) {
subscribeChannel = String.valueOf(subscribeChannelEditText.getText());
String yourSubscribeChannel = "Subscribed to the " + subscribeChannel + " Channel";
Toast.makeText(this, yourSubscribeChannel, Toast.LENGTH_LONG).show();
return subscribeChannel;
}
Your subscribeChannel variable is only visible within the scope of your onChannelButtonClick method. Declare it outside along with your instance variables.
public void onChannelButtonClick(View view) {
//here you set it and then it's lost.
String subscribeChannel = String.valueOf(subscribeChannelEditText.getText());
String yourSubscribeChannel = "Subscribed to the " + subscribeChannel + " Channel";
Toast.makeText(this, yourSubscribeChannel, Toast.LENGTH_LONG).show();
}
Instead do:
//declare it.
String subscribeChannel = null;
And then on your method assign the value.
public void onChannelButtonClick(View view) {
//assign it.
subscribeChannel = String.valueOf(subscribeChannelEditText.getText());
String yourSubscribeChannel = "Subscribed to the " + subscribeChannel + " Channel";
Toast.makeText(this, yourSubscribeChannel, Toast.LENGTH_LONG).show();
}

Categories

Resources