@@ -53,6 +53,8 @@ public class BootpayWebView extends WebView {
5353
5454 private Request request = null ;
5555
56+ private Context _context ;
57+
5658// private Locale locale = Locale.getDefault();
5759
5860 private boolean isLoaded = false ;
@@ -89,6 +91,7 @@ public void handleMessage(Message msg) {
8991
9092 public BootpayWebView (Context context ) {
9193 this (context , null );
94+ this ._context = context ;
9295 }
9396
9497// public BootpayWebView(Context context, Request request) {
@@ -97,6 +100,7 @@ public BootpayWebView(Context context) {
97100
98101 public BootpayWebView (Context context , AttributeSet attrs ) {
99102 this (context , attrs , 0 );
103+ this ._context = context ;
100104 }
101105
102106 private void goBootpayRequest () {
@@ -258,9 +262,19 @@ private boolean start(Intent intent, Context context) {
258262 }
259263
260264 private boolean gotoMarket (Intent intent , Context context ) {
265+ //context가 팝업인 웹뷰로 동작될 경우 no activity found 문제가 발생한다. 따라서 _context로 처리한다.
261266 final String appPackageName = intent .getPackage ();
262267 if (appPackageName == null ) {
263- context .startActivity (new Intent (Intent .ACTION_VIEW , intent .getData ()));
268+ Uri dataUri = intent .getData ();
269+
270+ try {
271+ context .startActivity (new Intent (Intent .ACTION_VIEW , intent .getData ()));
272+ } catch (Exception e ) {
273+ Log .d ("goToMarket Error" , e .getMessage ());
274+ if (dataUri != null || dataUri .toString ().startsWith ("nidlogin://" )) { //네이버 로그인일 경우 appPackageName이 비어 있이기에, 예외처리를 해주자
275+ context .startActivity (new Intent (Intent .ACTION_VIEW , Uri .parse ("https://play.google.com/store/apps/details?id=" + "com.nhn.android.search" )));
276+ }
277+ }
264278 return true ;
265279 }
266280 try {
0 commit comments