Search Results

Search found 4718 results on 189 pages for 'activity lifecycle'.

Page 4/189 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Click on notification starts activity twice

    - by Karussell
    I'm creating a notification from a service with the following code: NotificationManager notificationManager = (NotificationManager) ctx .getSystemService(Context.NOTIFICATION_SERVICE); CharSequence tickerText = "bla ..."; long when = System.currentTimeMillis(); Notification notification = new Notification(R.drawable.icon, tickerText, when); Intent notificationIntent = new Intent(ctx, SearchActivity.class). putExtra(SearchActivity.INTENT_SOURCE, MyNotificationService.class.getSimpleName()); PendingIntent contentIntent = PendingIntent.getActivity(ctx, 0, notificationIntent, 0); notification.setLatestEventInfo(ctx, ctx.getString(R.string.app_name), tickerText, contentIntent); notification.flags |= Notification.FLAG_AUTO_CANCEL; notificationManager.notify(1, notification); The logs clearly says that the the method startActivity is called twice times: 04-02 23:48:06.923: INFO/ActivityManager(2466): Starting activity: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,520][480,616] (has extras) } 04-02 23:48:06.923: WARN/ActivityManager(2466): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,520][480,616] (has extras) } 04-02 23:48:06.958: INFO/ActivityManager(2466): Starting activity: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,0][480,96] (has extras) } 04-02 23:48:06.958: WARN/ActivityManager(2466): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.SEARCH cmp=com.xy/.SearchActivity bnds=[0,0][480,96] (has extras) } 04-02 23:48:07.087: INFO/notification(5028): onStartCmd: received start id 2: Intent { cmp=com.xy/.NotificationService } 04-02 23:48:07.310: INFO/notification(5028): onStartCmd: received start id 3: Intent { cmp=com.xy/.NotificationService } 04-02 23:48:07.392: INFO/ActivityManager(2466): Displayed activity com.xy/.SearchActivity: 462 ms (total 462 ms) 04-02 23:48:07.392: INFO/ActivityManager(2466): Displayed activity com.xy/.SearchActivity: 318 ms (total 318 ms) Why are they started twice? There are two identical questions on stackoverflow: here and here. But they do not explain what the initial issue could be and they do not work for me. E.g. changing to launchMode singleTop is not appropriated for me and it should work without changing launchMode according to the official docs (see Invoking the search dialog). Nevertheless I also tried to add the following flags to notificationIntent Intent.FLAG_ACTIVITY_CLEAR_TOP | PendingIntent.FLAG_UPDATE_CURRENT but the problem remains the same.

    Read the article

  • Allowing AsyncTask to Manipulate Values in Different Activity Classes

    - by Matt
    Hi guys, This title may seem strange, so let me try to explain what I'm trying to do. I have several activity classes, each representing a different view in my application. My initial activity class gets loaded when the application launches. The user enters values and eventually a TCP socket is opened, and I then use AsyncTask to listen for and respond to messages from the server. I'd like for this AsyncTask class to essentially listen until the app is closed/error condition reached, and be able to update values in other activity classes after they are started. Does this make sense (it's been a long, frustrating night)? I know that static activity class references are bad practice, and touching the UI thread from other activities is bad as well, but I'm having trouble finding a clean solution to this problem. Maybe using AsyncTask is not the best approach here? Should I be using a service instead or something else entirely? Thanks in advance.

    Read the article

  • Listing an application's activity and intent-filters?

    - by MBonig
    I am interested in activating another application's activity. I know from reading the Android SDK that it's probably better to do this with an implicit intent. However, this activity doesn't reside in an application I own, so I don't know the action and category and data flags on the intent-filter. How can I examine an Android applications metadata like the activity classes and the intent-filters for those activities (if declared in the manifest)? Thanks!

    Read the article

  • Problems with starting an activity in onStart

    - by Fizz
    Hello everyone. I'm trying to start a floating activity from onStart to retrieve some info from the user right when the initial activity begins. I have the following: @Override public void onStart(){ super.onStart(); callProfileDialog(); } And callProfileDialog() is just: private void callProfileDialog(){ Intent i = new Intent(this, com.utility.ProfileDialog.class); startActivityForResult(i, PROFDIALOG); } ProfileDialog.class returns a String from an input box. If the result returned is RESULT_CANCELED then I restart the activity. The problem I'm having is that when the program starts, the screen is just black. If I hit the Back button a RESULT_CANCELED is returned then the initial activity shows as well as the floating activity (since it recalled itself when it got a RESULT_CANCELED). Why can't I get the activities show by calling ProfileDialog.class from onStart()? I got the same result when I called it at the end of onCreate() which is way I switch over to use onStart(). Thanks for the help.

    Read the article

  • [Android] Pass variable/intent to an activity when launched from a Widget

    - by Pelly
    Hi, Currently within an activity in my application I can call another activity and pass a variable to it in the following manner: Intent myIntent = new Intent(parentView.getContext(), ShowStations.class); myIntent.putExtra("stationName", stations[position].StationName); startActivity(myIntent); This works fine, but now I want to be able to do the same from my Widget. Currently this code works fine for launching a specific activity from my widget: Intent WidgetIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName("grell.com", "grell.com.FavStations")); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, WidgetIntent, 0); updateViews.setOnClickPendingIntent(R.id.widget_main, pendingIntent); So now I am wondering how can I launch the same activity as shown in the first example but also pass through the 'stationName' variable. Any help would be greatly appreciated. Cheers

    Read the article

  • Prevent Activity from saving state when user selects back button

    - by martinjd
    I have an Activity with a list that is bound to a ListAdapter reading data into a ArrayList from a database. All is well when the data is first loaded. While the Activity is open and the list is being displayed it is possible and likely that the data in the database will be updated by a service but the list does not reflect the changes because the ArrayList does not know about the changes. If the Activity is no longer in the foreground as would be the case if the user goes to the home screen and then is brought back to the foreground I would like for the Activity to not display what it did prior but rather reload the data using the ListAdapter the view is bound to. I think something needs to call finish() but I am not sure what. This is what I have in the Activity. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setUpViews(); app = (MyApplication) getApplication(); adapter = new MyListAdapter(this, app.getMyEvents()); setListAdapter(adapter); } @Override protected void onResume() { super.onResume(); adapter.forceReload(); }

    Read the article

  • ListView Item Detail Screen: New or Same Activity?

    - by stormin986
    I have a listview where each item correlates to an instance of an item in an array. When the user selects an item, it will bring up a 'Details' page that reads and displays other data members of the list item. Would this be better implemented with the Details page as its own activity, or a new view within the same activity? Pros and cons of each? A new activity makes my job a little easier in terms of handling the 'back' button, but then I have the challenge of how do I pass the rest of the data structure to the new activity since I can't bundle it up (unless I serialize it).

    Read the article

  • Agile PLM on Developing Agile PLM: Software Lifecycle Management

    - by Kerrie Foy
    Change is constant.  That saying couldn’t be truer when applied to software development.   And with all that change comes extensive product complexity.  How do you manage it all?  As software developers ourselves, we can certainly empathize with the challenge. On April 3, 2012 Stephen Van Lare, VP of PLM Product Development, hosted a webcast to share how Oracle uses Agile to develop Agile – a PLM solution for managing a PLM solution!   Stephen passionately shared his unique insight based on 10 years of using Agile PLM to manage the development process, as well as customer use cases.  He shared our time-proven view of the software’s relationship to the product record, while pointing out that PLM is not source control.  He began with the challenges of software development, which boiled down to the deduction that “despite many great tools in the software development industry, it takes a lot more than good source control, more than good bug tracking, to get to an on-time, on-budget and quality release in your marketplace.   It requires defining the right things you want to do, managing the scope, managing your schedule, and, most importantly, managing the change to all those things over the lifecycle of the process. And this is the definition of PLM.”   Stephen then defined the relationship of PLM to the software development process by detailing the two main use cases –  Product Lifecycle and Mechatronics – which can be used simultaneously and in fact are already used in most industries today.  The Product Lifecycle use case is used to manage artifacts and change throughout product development, while the Mechatronics use case involves the software, hardware and electrical design in the BOM.  In essence, PLM is just as relevant to software as the rest of the BOM when trying to maximize profits during any phase of the lifecycle. Please take the opportunity to watch Stephen Van Lare as he details how and why based on his own experience developing Agile with Agile, as well as a lively Q&A session, in the Software PLM Webcast Replay.

    Read the article

  • Lifecycle of an ASP.NET MVC 5 Application

    Here you can download a PDF Document that charts the lifecycle of every ASP.NET MVC 5 application, from receiving the HTTP request to sending the HTTP response back to the client. It is designed both as an educational tool for those who are new to ASP.NET MVC and also as a reference for those who need to drill into specific aspects of the application. The PDF document has the following features: Relevant HttpApplication stages to help you understand where MVC integrates into the ASP.NET application lifecycle. A high-level view of the MVC application lifecycle, where you can understand the major stages that every MVC application passes through in the request processing pipeline. A detail view that shows drills down into the details of the request processing pipeline. You can compare the high-level view and the detail view to see how the lifecycles details are collected into the various stages. Placement and purpose of all overridable methods on the Controller object in the request processing pipeline. You may or may not have the need to override any one method, but it is important for you to understand their role in the application lifecycle so that you can write code at the appropriate life cycle stage for the effect you intend. Blown-up diagrams showing how each of the filter types (authentication, authorization, action, and result) is invoked. Link to a useful article or blog from each point of interest in the detail view. span.fullpost {display:none;}

    Read the article

  • JSP tag lifecycle

    - by mkoryak
    i just introduced a bug into my code because i seem to have misunderstood the jsp tag lifecycle. The tag worked like this before the bug: i pass the tag some collection as an attribute, and it displays it as a table. The collection was passed into the JSP from the controller. after the bug: a removed the attribute which set the collection. instead, in the tag i check if the collection is null, and then grab it by name from the request (using a naming convention). the thing that i didnt expect: after the collection was initially set in the tag, it would never become null on subsequent executions! it was still defined as an non-requred attribute in the TLD. I expected the tag to not hold on to previous values between executions.

    Read the article

  • New VS2012 Book: Pro Application Lifecycle Management with Visual Studio 2012

    - by Jakob Ehn
    During the spring/summer I have been involved with reviewing a new book about Visual Studio 2012 ALM from Apress called “Pro Application Lifecycle Management with Visual Studio 2012” The book is written by a fellow Visual Studio ALM MVP Mathias Olausson and his colleague Joachim Rossberg. It is a very comprehensive book that covers both all aspects of ALM in general and also how to implement these practices with Visual Studio 2012. The book also has several chapters dedicated to measuring your improvements by using ALM assessments and metrics. Read more about the book here on Mathias blog: http://msmvps.com/blogs/molausson/archive/2012/07/17/book-project-pro-application-lifecycle-management-with-visual-studio-2012-completed.aspx You can pre-order the book here at Amazon: http://www.amazon.com/Application-Lifecycle-Management-Visual-Professional/dp/1430243449/ Check it out!

    Read the article

  • New Solaris 11 Customer Maintenance Lifecycle blog

    - by user12244672
    Hi Folks, On the basis that you can't have too much of a good thing, I've started a 2nd blog, the Solaris11Life blog , to enable me to blog about all aspects of the Solaris 11 Customer Maintenance Lifecycle, including policies, best practices, resource links, clarifications, and anything else which I hope you may find useful. In my first post, I share my Solaris 11 Customer Maintenance Lifecycle presentation, which I gave at Oracle Open World and the recent Deutsche Oracle Anwendergruppe (DOAG) conference. I'll be posting lots more there in the coming week as time allows, including secret handshake stuff on how to interpret IPS FMRI version strings. In future, I'll post any Solaris 11 Customer Maintenance Lifecycle related material on the Solaris11Life blog, http://blogs.oracle.com/Solaris11Life , and any Solaris 10 or below material here on the Patch Corner blog, http://blogs.oracle.com/patch . Best Wishes, Gerry.

    Read the article

  • launching mapview from main activity (button)

    - by arc
    Hi all. Going round in circles here i think. I have an activity called Locate; public class Locate extends Activity { public static String lat; public static String lon; public static String number; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.locate); final Button buttonMaps = (Button) findViewById(R.id.ButtonMaps); buttonMaps.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Toast.makeText(getBaseContext(), "Button Pressed", Toast.LENGTH_SHORT).show(); try { Intent i = new Intent(getBaseContext(), displayMap.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); } catch (ActivityNotFoundException e) { Toast.makeText(getBaseContext(), "Activity Not Found", Toast.LENGTH_SHORT).show(); } }}); // Toast.makeText(getBaseContext(), "lat: " + lat + " long: " + lon + " from: " + testname, Toast.LENGTH_LONG).show(); } If I make the displayMap class into a normal Activity, and just have display a toast message confirming it has loaded - then it works fine. If i do this though; public class displayMap extends MapActivity { /** Called when the activity is first created. */ public void onCreate() { setContentView(R.layout.displaymap); Toast.makeText(getBaseContext(), "Display Map", Toast.LENGTH_SHORT).show(); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } Then as soon as I click the Button, I get a force close. I have the correct 'uses-library' tag in my manifest; <application android:icon="@drawable/icon" android:label="@string/app_name"> <uses-library android:name="com.google.android.maps" /> I don't get what it just force closes everytime i try and load it. If I make this my onClick handler then it will fire up a working googlemaps/default mapview public void onClick(View v) { Toast.makeText(getBaseContext(), "Button Pressed", Toast.LENGTH_SHORT).show(); Uri uri=Uri.parse("geo:"+Locate.lat+","+Locate.lon); StartActivity(new Intent(Intent.ACTION_VIEW, uri)); } But that is not what I am trying to do, I want my own - so that I can add overlays etc to it. But it does prove that the permission are set correctly and that the lib is there. The logcat error when the app FCs is a Unexpected DEX error. Can anyone point in the right direction here?

    Read the article

  • Dynamically created controls and the ASP.NET page lifecycle

    - by Dirk
    I'm working on an ASP.NET project in which the vast majority of the forms are generated dynamically at run time (form definitions are stored in a DB for customizability). Therefore, I have to dynamically create and add my controls to the Page every time OnLoad fires, regardless of IsPostBack. This has been working just fine and .NET takes care of managing ViewState for these controls. protected override void OnLoad(EventArgs e) { base.OnLoad(e); RenderDynamicControls() } private void RenderDynamicControls(){ //1. call service layer to retrieve form definition //2. create and add controls to page container } I have a new requirement in which if a user clicks on a given button (this button is created at design time) the page should be re-rendered in a slightly different way. So in addition to the code that executes in OnLoad (i.e. RenderDynamicControls()), I have this code: protected void MyButton_Click(object sender, EventArgs e) { RenderDynamicControlsALittleDifferently() } private void RenderDynamicControlsALittleDifferently() (){ //1. clear all controls from the page container added in RenderDynamicControls() //2. call service layer to retrieve form definition //3. create and add controls to page container } My question is, is this really the only way to accomplish what I'm after? It seems beyond hacky to effectively render the form twice simply to respond to a button click. I gather from my research that this is simply how the page-lifecycle works in ASP.NET: Namely, that OnLoad must fire on every Postback before child events are invoked. Still, it's worthwhile to check with the SO community before having to drink the kool-aid. On a related note, once I get this feature completed, I'm planning on throwing an UpdatePanel on the page to perform the page updates via Ajax. Any code/advice that make that transition easier would be much appreciated. Thanks

    Read the article

  • Android lifecycle of thread-based game

    - by ehehhh
    I ran into a bit of trouble while trying to get my game to work correctly after being put to the background by the user or a phone call for example. My app has a SurfaceView class called GameView, which has the onDraw() method to do all the necessary drawing for my game and two threads - one for calling the onDraw() and one for doing the necessary calculations for the game's logic. I succesfully implemented onPause() and onResume(). (I paused both threads when back button was pressed and resumed them after user cancelled in the AlertDialog.) Now I would like to have the game paused the same way when onStop() gets called. I put both threads on pause and saved my characters location in the savedInstanceState, but when I start my app again, no method gets called (I checked with Logcat). I believe onRestart() should be called first, then onStart() and then onResume(), but none of that happens. What am I doing wrong? (Didn't include any code, because it seems to be a problem of me not understanding the lifecycle, not a problem in code. If it seems necessary, I'll post the parts you request.)

    Read the article

  • Android Status Bar Notifications - Opening the correct activity when selecting a notification

    - by Mr Zorn
    I have been having a problem with a notification not opening/going to the correct activity when it has been clicked. My notification code (located in a class which extends Service): Context context = getApplicationContext(); CharSequence contentTitle = "Notification"; CharSequence contentText = "New Notification"; final Notification notifyDetails = new Notification(R.drawable.icon, "Consider yourself notified", System.currentTimeMillis()); Intent notifyIntent = new Intent(context, MainActivity.class); PendingIntent intent = PendingIntent.getActivity(context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL); notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent); ((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notifyDetails); If I click the notification while the application which created the service is open, the notification disappears (due to the FLAG_AUTO_CANCEL) but the activity does not switch. If I click the notification from the home screen, the notification disappears and my app is brought to the front, however it remains on the activity which was open before going to the home screen, instead of going to the main screen. What am I doing wrong? How do I specify the activity that will be pulled up?

    Read the article

  • Android Video Layout and backbutton to activity

    - by Marcjc
    I have an application where you can click on a button, this takes you to a new activity with four new buttons, listen, bio, ringtone, and watch. My watch button kicks off the following code: Button cmd_watchme = (Button)this.findViewById(R.id.watch); cmd_watchme.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { setContentView(R.layout.tvvideo); VideoView video=(VideoView)findViewById(R.id.VideoView); MediaController mediaController = new MediaController(andy.this); mediaController.setAnchorView(video); video.setMediaController(mediaController); video.setVideoURI(videopath); video.start(); } }); After the video is displayed I am trying to get the backbutton on the phone itself to take the user back to the four button selection activity, listen, bio, ringtone, and watch. Question is, how do i do this? I was figuring if there was a way to change the ContentView after the video is displayed back to the main one for the four button page but could not figure it out. When I press the backbutton on the device, it takes me two levels up to the main selection activity not the four button activity. I hope this was somewhat clear. Thanks for any help.

    Read the article

  • I need to recover an instance of an activity

    - by Bilthon
    Well.. the title is pretty descriptive, I have a bunch of tab activities (which I implemented myself, didn't want to use the tabviews with activities inside them), so It's basically 5 activities calling each other every time the user clicks on the tabs displayed as a row of LinearLayouts at the bottom of the screen. The thing is that the way I do it now, everytime the user jumps from one activity to another, a new activity is created and launched. Of course, I can see I'm wasting resources this way. So what I would like to do is to create every activity only once; and then if the user wants to go back to the previous (or any one that was already created and is probably paused) just check on some kind of list or array to see if the activity can be recovered and only in the case it can't; to lauch a new one. My question is, how can I check this? should I save the intents? and how to recover the activities afterwards? I'm kind of new with java. Greetings Nelson R. Perez

    Read the article

  • Passing bundle to activity set as singletask

    - by Falmarri
    So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it's displaying on the map (via a string). I originally pass this string in from the intent when the activity is first created. And then if you click on one of the drawables on the map, it opens a new activity, which can then create a new mapview (same class) with a different string setting. The problem I have is that I only want one instance of the mapview to be running at once. Thus I set android:launchmode="singletask" in the manifest. This works in that it brings the mapactivity to the front, but is there any way to send it a new intent bundle to get a new setting for the string it needs? I tried regetting the extras from the bundle, but it seems to retain the old bundle, not the new intent that was passed to it. I'm not sure I want to do startActivityForResult because the 2nd activity may or may not want to update the original activity. I hope that made sense. I can post code if necessary, but I think that should explain my situation.

    Read the article

  • Dismiss android activity displayed as Popup

    - by Sit
    So i have a service, that starts an activity displayed as a Popup thank's to "android:style/Theme.Dialog" This Activity shows a Listview, with a list of application. On each element of the listview, there is a short description of the application, and two buttons. 1 for launching the application 2 for displaying a toast with more informations. Here is the code in my service : it starts the activity Intent intent = new Intent(this, PopUpActivity.class); intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplicationContext().startActivity(intent); this activity uses a custom layout, with a listview, adapted with a custom ArrayAdapter In this adaptater, i've put an action on the start button in order to start the current application Button lanceur = (Button) v.findViewById(R.id.Buttonlancer); lanceur.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { p.start(mcontext); } }); with p.start, i start the application. But now, if i press "back" from the application, i go back to the popup... and i can start another application. I don't want it to be possible. That's why i wish i could dismiss/destroy/finish my PopupActivity, but i can't manage to do it with the code i have.

    Read the article

  • Activity won't start a service

    - by Marko Cakic
    I m trying to start an IntentService from the main activity of y application and it won't start. I have the service in the manifest file. Here's the code: MainActivity public class Home extends Activity { private LinearLayout kontejner; IntentFilter intentFilter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); kontejner = (LinearLayout) findViewById(R.id.kontejner); intentFilter = new IntentFilter(); startService(new Intent(getBaseContext(), HomeService.class)); } } Service: public class HomeService extends IntentService { public HomeService() { super("HomeService"); // TODO Auto-generated constructor stub } @Override protected void onHandleIntent(Intent intent) { Toast.makeText(getBaseContext(), "TEST", Toast.LENGTH_LONG).show(); } } Manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.salefinder" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".Home" android:label="@string/title_activity_home" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name=".HomeService" /> </application> <uses-permission android:name="android.permission.INTERNET"/> </manifest> How can I make it work?

    Read the article

  • .net ViewState in page lifecycle

    - by caltrop
    I have a page containing a control called PhoneInfo.ascx. PhoneInfo is dynamically created using LoadControl() and then the initControl() function is called passing in an initialization object to set some initial textbox values within PhoneInfo. The user then changes these values and hits a submit button on the page which is wired up to the "submit_click" event. This event invokes the GetPhone() function within PhoneInfo. The returned value has all of the new user entered values except that the phoneId value (stored in ViewState and NOT edited by the user) always comes back as null. I believe that the viewstate is responsible for keeping track of user entered data across a postback, so I can't understand how the user values are coming back but not the explicitly set ViewState["PhoneId"] value! If I set the ViewState["PhoneId"] value in PhoneInfo's page_load event, it retrieves it correctly after the postback, but this isn't an option because I can only initialize that value when the page is ready to provide it. I'm sure I am just messing up the page lifecycle somehow, any suggestion or questions would really help! I have included a much simplified version of the actual code below. Containing page's codebehind protected void Page_Load(object sender, EventArgs e) { Phone phone = controlToBind as Phone; PhoneInfo phoneInfo = (PhoneInfo)LoadControl("phoneInfo.ascx"); //Create phoneInfo control phoneInfo.InitControl(phone); //use controlToBind to initialize the new control Controls.Add(phoneInfo); } protected void submit_click(object sender, EventArgs e) { Phone phone = phoneInfo.GetPhone(); } PhoneInfo.ascx codebehind protected void Page_Load(object sender, EventArgs e) { } public void InitControl(Phone phone) { if (phone != null) { ViewState["PhoneId"] = phone.Id; txt_areaCode.Text = SafeConvert.ToString(phone.AreaCode); txt_number.Text = SafeConvert.ToString(phone.Number); ddl_type.SelectedValue = SafeConvert.ToString((int)phone.Type); } } public Phone GetPhone() { Phone phone = new Phone(); if ((int)ViewState["PhoneId"] >= 0) phone.Id = (int)ViewState["PhoneId"]; phone.AreaCode = SafeConvert.ToInt(txt_areaCode.Text); phone.Number = SafeConvert.ToInt(txt_number.Text); phone.Type = (PhoneType)Enum.ToObject(typeof(PhoneType), SafeConvert.ToInt(ddl_type.SelectedValue)); return phone; } }

    Read the article

  • Immediately starting a new activity from an activity

    - by HowsItStack
    When I was originally learning about Android a few months ago I swear I read something about a way to immediately launch an activity when starting a task. I am curious about this now because I need to display an intro screen on launch but I don't want the intro screen to be the root activity. Does anyone know if there is something like this and if not what is the best way to handle an intro screen? I tried googling for a few hours to find it but can't for the life of me. Thanks for the help.

    Read the article

  • [android] Activity group throw ActivityNotFoundException?

    - by Mak Sing
    Hi, I want to change the current activity inside a tab in a tab activity, after some research, I know that I need to use activity group to go this. then I created a new class extends ActivityGroup with the code below: public class FavShop extends ActivityGroup{ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LocalActivityManager m = getLocalActivityManager(); Intent i = new Intent(this, fav_shops.class); Window window = m.startActivity("favourite shop",i); setContentView(window.getDecorView()); } } then I run the program, the program throw the ActivityNotFoundException when the intent for the tab is launched I have no idea how to solve this problem, could anyone help me?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >