small bugfix

This commit is contained in:
NudeDude 2018-08-12 13:38:04 +02:00
parent caee4813fe
commit 01f9adc466
2 changed files with 9 additions and 10 deletions

View File

@ -44,7 +44,6 @@ public class MainActivity extends AppCompatActivity implements OnRefreshListener
private Toolbar toolbar;
private TabHost tabhost;
private int tabIndex = 0;
private long homeId = 0L;
private boolean settingChanged = false;
private final int REQ_CODE = 1;
@ -61,7 +60,6 @@ public class MainActivity extends AppCompatActivity implements OnRefreshListener
startActivityForResult(i,REQ_CODE);
}
homeId = settings.getUserId();
timelineList = findViewById(R.id.tl_list);
trendList = findViewById(R.id.tr_list);
mentionList = findViewById(R.id.m_list);
@ -144,6 +142,7 @@ public class MainActivity extends AppCompatActivity implements OnRefreshListener
Intent intent;
switch(item.getItemId()) {
case R.id.action_profile:
long homeId = settings.getUserId();
intent = new Intent(this, UserProfile.class);
intent.putExtra("userID", homeId);
intent.putExtra("username", "");

View File

@ -90,16 +90,16 @@ public class TwitterEngine {
*
* @param twitterPin PIN for accessing account
* @throws TwitterException if pin is false
* @throws NullPointerException if Request-Token is not set
* @see #initKeys(String, String)
*/
public void initialize(String twitterPin) throws TwitterException, NullPointerException {
if (reqToken == null) throw new NullPointerException("empty request token");
AccessToken accessToken = twitter.getOAuthAccessToken(reqToken, twitterPin);
String key1 = accessToken.getToken();
String key2 = accessToken.getTokenSecret();
initKeys(key1, key2);
saveCurrentUser(key1, key2);
public void initialize(String twitterPin) throws TwitterException {
if (reqToken != null) {
AccessToken accessToken = twitter.getOAuthAccessToken(reqToken, twitterPin);
String key1 = accessToken.getToken();
String key2 = accessToken.getTokenSecret();
initKeys(key1, key2);
saveCurrentUser(key1, key2);
}
}
/**