Can Views such as ScrollView, Panel, Buttons, EditTexts be declared in the class which can be reused from multiple activities?No. Each activity must be declared in the manifest file. However you can implement most of the activity logic in a class and then reuse this class from multiple activities.
Only if you want to remove it from the activities stack.hould i also finish the main avtivity if i want to go to other activities?
If you are accessing process global variables then yes.the problem is that i want to use parameters that are in the main activity and change them, can i do that also if the main activity is called with activity.finish??
See this quiz: http://www.basic4ppc.com/android/forum/threads/quiz-12-find-the-bug-process-activities-life-cycle.37899/and why afte ri press in main screen the back button and i exit my application when i return i get a blank screen??
okWould be better if you show us the code than a video on the problem. Without the code we can only guess what you have done wrong.
#Region Project Attributes #ApplicationLabel: Ninja Hop #VersionCode: 13 #VersionName: 1.42 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: landscape #CanInstallToExternalStorage: False #AdditionalRes: C:\Android SDK\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms #End Region #Region Activity Attributes #FullScreen: true #IncludeTitle: false #End Region 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim t1 As Timer End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim img As ImageView Dim a1 As Animation Dim x As Int Dim y As Int End Sub Sub Activity_Create(FirstTime As Boolean) If FirstTime = True Then img.Initialize ("img") img.Bitmap = LoadBitmap(File.DirAssets , "pro2.png") img.Gravity = Gravity.FILL Activity.Color = Colors.White y = (Activity.Height / 2) - 38dip x = (Activity.Width / 2) - 100dip Activity.AddView (img, x,y, 200dip ,76dip ) t1.Initialize ("t1", 2000) a1.InitializeAlpha("",0,1) a1.start(img) a1.Duration = 1500 a1.RepeatCount = 0 'a3.RepeatMode = a3.REPEAT_REVERSE t1.Enabled = True End If End Sub Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then Return True Else Return False End If End Sub Sub t1_tick t1.Enabled = False StartActivity(menu) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) Activity.Finish End Sub
this is what i want, the timer will start after 2 seconds and start activity menu (and will finish activity main)The timer is never enabled when FirstTime is false.