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

View File

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