Skip to content

Commit

Permalink
bugfix: 修复无法发帖的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
KingsFish committed Jan 4, 2020
1 parent 15c41c5 commit 7f3f439
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions app/src/main/java/me/yluo/ruisiapp/activity/NewPostActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ public class NewPostActivity extends BaseActivity implements View.OnClickListene
private String title;
private int typeId;

public static final String FID = "fid";
public static final String TITLE = "title";

public static void open(Context context, int fid, String title) {
Intent intent = new Intent(context, NewPostActivity.class);
intent.putExtra("FID", fid);
intent.putExtra("TITLE", title);
intent.putExtra(FID, fid);
intent.putExtra(TITLE, title);
context.startActivity(intent);
}

Expand All @@ -109,8 +112,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_new_topic);

if (getIntent().getExtras() != null) {
fid = getIntent().getExtras().getInt("FID");
title = getIntent().getExtras().getString("TITLE");
fid = getIntent().getExtras().getInt(FID);
title = getIntent().getExtras().getString(TITLE);
}

if (!TextUtils.isEmpty(title)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ public void onClick(View view) {
} else {
if (isLogin()) {
Intent i = new Intent(this, NewPostActivity.class);
i.putExtra("fid", fid);
i.putExtra("title", title);
i.putExtra(NewPostActivity.FID, fid);
i.putExtra(NewPostActivity.TITLE, title);
startActivityForResult(i, 0);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void handleClick(final Context context, String url) {
} else if (url.contains("forum.php?mod=post&action=newthread")) { //发帖链接
int fid = GetId.getFroumFid(url);
Intent i = new Intent(context, NewPostActivity.class);
i.putExtra("FID", fid);
i.putExtra(NewPostActivity.FID, fid);
context.startActivity(i);
} else if (url.contains("member.php?mod=logging&action=login")) {//登陆
LoginActivity.open(context);
Expand Down

0 comments on commit 7f3f439

Please sign in to comment.