با سلام من بعد زمان ریادی یک منو خوب پیدا کردم نرم افزارم هم هیچ مشکلی نداشت وقتی این منو رو اضافه کردم تو نرم افزار هی پیغام میده کد هام رو کامل پیوست می کنم
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim timer1 As Timer
Dim tm As Timer
End Sub
Sub Globals
Private EditText1 As EditText
Private EditText2 As EditText
Private webview1 As WebView
Dim web As WebViewExtras
Private Label1 As Label
Dim aria As AriaLib
Private button1 As Button
Dim Nav As AHNavigationDrawer
Dim parentpanel As Panel
Private ListView1 As ListView
Private ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("L2222")
EditText1.TextColor= Colors.Black
EditText2.TextColor= Colors.Black
EditText1.Gravity=Gravity.RIGHT
EditText2.Gravity=Gravity.RIGHT
Label1.Gravity=Gravity.RIGHT
Label1.TextColor= Colors.Black
webview1.LoadUrl("http://portal..net")
web.AddJavascriptInterface(webview1,"learnnet")
web.addWebChromeClient(webview1,"")
ProgressDialogShow2("loadding",False)
webview1.Visible=False
If aria.TestInterntConnection = False Then
ToastMessageShow("اینترنت شما قطع است",False)
StartActivity("main3")
Activity.Finish
End If
webview1.ZoomEnabled=False
tm.Initialize("tm",5)
tm.Enabled = True
If webview1.Url.Contains("https:/.net/welcome") Then
Else
End If
parentpanel.Initialize("")
Activity.Title="basic4android.org"
Activity.AddView(parentpanel,0,0,100%x,100%Y)
'Nav.Initialize("nav",parentpanel,60%x)
Nav.Initialize2("nav",Activity,60%x,Nav.GRAVITY_RIGHT)
Nav.ContentPanel.LoadLayout("l2222")
Nav.NavigationPanel.LoadLayout("navigationpanel")
Nav.SetEdgeSize(Nav.GRAVITY_END,100dip)
ImageView1.Bitmap=LoadBitmap(File.DirAssets,"photo_2016-12-18_01-07-58.jpg")
ListView1.AddTwoLines("basic4android",1)
ListView1.AddTwoLines("basic4android",2)
ListView1.AddTwoLines("basic4android",3)
ListView1.AddTwoLines("basic4android",4)
ListView1.TwoLinesLayout.Label.textColor=Colors.Black
End Sub
Sub List1_ItemClick (Position As Int, Value As Object)
If Position=0 Then
End If
If Position=1 Then
End If
If Position=2 Then
End If
If Position=3 Then
End If
If Position=4 Then
End If
If Position=5 Then
End If
If Position=6 Then
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub webview1_pageFinished (Url As String)
ProgressDialogHide
web.executeJavascript(webview1,"learnnet.cullsub('getHtml',true,document.documentElment.outerHTML)")
If webview1.Url.Contains("https:/net/welcome") Then
Label1.text = "وارد شدید"
webview1.Visible=True
EditText1.Visible=False
EditText2.Visible=False
Label1.Visible=False
button1.Visible=False
EditText1.Enabled=False
EditText2.Enabled=False
Label1.Enabled=False
button1.Enabled=False
Else
End If
End Sub
Sub getHTML(amir As String)
amir= amir.Replace("""","'")
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
web.executeJavascript(webview1,"document.getElementsByClassName('mtik-username tooltips')[0].value = '"&New&"'")
End Sub
Sub EditText2_TextChanged (Old As String, New As String)
web.executeJavascript(webview1,"document.getElementsByClassName('mtik-password tooltips')[0].value = '"&New&"'")
End Sub
Sub Button1_Click
web.executeJavascript(webview1,"document.getElementsByClassName('btn btn-block login-btn')[0].click();")
timer1.Initialize("Timer1",1000)
timer1.Enabled = True
End Sub
Sub timer1_Tick
timer1.Enabled = True
If webview1.Url.Contains("https://.net/welcome") Then
Label1.text = "وارد شدید"
webview1.Visible=True
EditText1.Visible=False
EditText2.Visible=False
Label1.Visible=False
button1.Visible=False
EditText1.Enabled=False
EditText2.Enabled=False
Label1.Enabled=False
button1.Enabled=False
Else
Label1.text = "مشخصات اشتباه است"
End If
End Sub'
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Dim i As Int
i = Msgbox2 ("میخواهید از برنامه خارج شوید "," خارج شدن","بله ","خیر","",Null)
If i = DialogResponse.POSITIVE Then
ExitApplication
Else If i = DialogResponse.CANCEL Then
Return True
Else If i = DialogResponse.NEGATIVE Then
End If
Else If KeyCode = KeyCodes.KEYCODE_MENU Then
Nav.OpenDrawer2(Nav.GRAVITY_RIGHT)
End If
End Sub
Sub tm_Tick
If webview1.Url.Contains("https://.net/login") Then
webview1.Visible=False
EditText1.Visible=True
EditText2.Visible=True
Label1.Visible=True
button1.Visible=True
EditText1.Enabled=True
EditText2.Enabled=True
Label1.Enabled=True
button1.Enabled=True
End If
End Sub
سوال
mostafa.kasiri 115
با سلام من بعد زمان ریادی یک منو خوب پیدا کردم نرم افزارم هم هیچ مشکلی نداشت وقتی این منو رو اضافه کردم تو نرم افزار هی پیغام میده کد هام رو کامل پیوست می کنم
#Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals Dim timer1 As Timer Dim tm As Timer End Sub Sub Globals Private EditText1 As EditText Private EditText2 As EditText Private webview1 As WebView Dim web As WebViewExtras Private Label1 As Label Dim aria As AriaLib Private button1 As Button Dim Nav As AHNavigationDrawer Dim parentpanel As Panel Private ListView1 As ListView Private ImageView1 As ImageView End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("L2222") EditText1.TextColor= Colors.Black EditText2.TextColor= Colors.Black EditText1.Gravity=Gravity.RIGHT EditText2.Gravity=Gravity.RIGHT Label1.Gravity=Gravity.RIGHT Label1.TextColor= Colors.Black webview1.LoadUrl("http://portal..net") web.AddJavascriptInterface(webview1,"learnnet") web.addWebChromeClient(webview1,"") ProgressDialogShow2("loadding",False) webview1.Visible=False If aria.TestInterntConnection = False Then ToastMessageShow("اینترنت شما قطع است",False) StartActivity("main3") Activity.Finish End If webview1.ZoomEnabled=False tm.Initialize("tm",5) tm.Enabled = True If webview1.Url.Contains("https:/.net/welcome") Then Else End If parentpanel.Initialize("") Activity.Title="basic4android.org" Activity.AddView(parentpanel,0,0,100%x,100%Y) 'Nav.Initialize("nav",parentpanel,60%x) Nav.Initialize2("nav",Activity,60%x,Nav.GRAVITY_RIGHT) Nav.ContentPanel.LoadLayout("l2222") Nav.NavigationPanel.LoadLayout("navigationpanel") Nav.SetEdgeSize(Nav.GRAVITY_END,100dip) ImageView1.Bitmap=LoadBitmap(File.DirAssets,"photo_2016-12-18_01-07-58.jpg") ListView1.AddTwoLines("basic4android",1) ListView1.AddTwoLines("basic4android",2) ListView1.AddTwoLines("basic4android",3) ListView1.AddTwoLines("basic4android",4) ListView1.TwoLinesLayout.Label.textColor=Colors.Black End Sub Sub List1_ItemClick (Position As Int, Value As Object) If Position=0 Then End If If Position=1 Then End If If Position=2 Then End If If Position=3 Then End If If Position=4 Then End If If Position=5 Then End If If Position=6 Then End If End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub webview1_pageFinished (Url As String) ProgressDialogHide web.executeJavascript(webview1,"learnnet.cullsub('getHtml',true,document.documentElment.outerHTML)") If webview1.Url.Contains("https:/net/welcome") Then Label1.text = "وارد شدید" webview1.Visible=True EditText1.Visible=False EditText2.Visible=False Label1.Visible=False button1.Visible=False EditText1.Enabled=False EditText2.Enabled=False Label1.Enabled=False button1.Enabled=False Else End If End Sub Sub getHTML(amir As String) amir= amir.Replace("""","'") End Sub Sub EditText1_TextChanged (Old As String, New As String) web.executeJavascript(webview1,"document.getElementsByClassName('mtik-username tooltips')[0].value = '"&New&"'") End Sub Sub EditText2_TextChanged (Old As String, New As String) web.executeJavascript(webview1,"document.getElementsByClassName('mtik-password tooltips')[0].value = '"&New&"'") End Sub Sub Button1_Click web.executeJavascript(webview1,"document.getElementsByClassName('btn btn-block login-btn')[0].click();") timer1.Initialize("Timer1",1000) timer1.Enabled = True End Sub Sub timer1_Tick timer1.Enabled = True If webview1.Url.Contains("https://.net/welcome") Then Label1.text = "وارد شدید" webview1.Visible=True EditText1.Visible=False EditText2.Visible=False Label1.Visible=False button1.Visible=False EditText1.Enabled=False EditText2.Enabled=False Label1.Enabled=False button1.Enabled=False Else Label1.text = "مشخصات اشتباه است" End If End Sub' Sub Activity_KeyPress (KeyCode As Int) As Boolean If KeyCode = KeyCodes.KEYCODE_BACK Then Dim i As Int i = Msgbox2 ("میخواهید از برنامه خارج شوید "," خارج شدن","بله ","خیر","",Null) If i = DialogResponse.POSITIVE Then ExitApplication Else If i = DialogResponse.CANCEL Then Return True Else If i = DialogResponse.NEGATIVE Then End If Else If KeyCode = KeyCodes.KEYCODE_MENU Then Nav.OpenDrawer2(Nav.GRAVITY_RIGHT) End If End Sub Sub tm_Tick If webview1.Url.Contains("https://.net/login") Then webview1.Visible=False EditText1.Visible=True EditText2.Visible=True Label1.Visible=True button1.Visible=True EditText1.Enabled=True EditText2.Enabled=True Label1.Enabled=True button1.Enabled=True End If End Sub
و این هم عکس از تصویر خطا
دیگه فکر نکنم بهتر بتونم توضیح بدم
ممنون میشم پاسخ بدید
لینک ارسال
به اشتراک گذاری در سایت های دیگر
8 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.