Skip to content

Commit

Permalink
fix(crash): 解决BaseTransFragment没有实现空参构造函数导致的崩溃问题2
Browse files Browse the repository at this point in the history
  • Loading branch information
hss01248 committed Jun 28, 2022
1 parent 59ae80a commit d6a4dbc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
import com.hss01248.transfrag.BaseTransFragment;

public class EmptyFragment extends BaseTransFragment<Intent> {

public EmptyFragment() {
super();
}

ActivityResultListener listener;
public EmptyFragment(FragmentActivity activity, Intent o) {
super(activity, o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public void onStart() {


protected void onStartOfResultBack(int requestCode, int resultCode, @Nullable Intent data) {
listener.onActivityResult(requestCode,resultCode,data);
if(listener != null){
listener.onActivityResult(requestCode,resultCode,data);
}

if (StartActivityUtil.debugable) {
Log.i("onActivityResult2", "req:" + requestCode + ",result:onStartOfResultBack,data:null" );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
* desription:
*/
public class InAppResultFragment extends BaseTransFragment<Intent> {

public InAppResultFragment() {
super();
}

public InAppResultFragment(FragmentActivity activity, Intent intent) {
super(activity, intent);
}
Expand Down Expand Up @@ -43,7 +48,9 @@ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent d
if (StartActivityUtil.debugable) {
Log.i("onActivityResult", "req:" + requestCode + ",result:" + resultCode + ",data:" + data);
}
listener.onActivityResult(requestCode,resultCode,data);
if(listener != null){
listener.onActivityResult(requestCode,resultCode,data);
}
finish();
if(requestCode == this.requestCode){
//listener.onActivityResult(requestCode,resultCode,data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public void onDestroy() {
if(callback != null){
callback.onDestroy();
}
finish();
}


Expand Down

0 comments on commit d6a4dbc

Please sign in to comment.