ProfileList: Load fragment programmatically
This is necessary to replace it with the profile detail fragment later. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
		
							parent
							
								
									93e304ba2d
								
							
						
					
					
						commit
						372477d0e0
					
				@ -1,6 +1,7 @@
 | 
				
			|||||||
package com.wireguard.android;
 | 
					package com.wireguard.android;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import android.app.Activity;
 | 
					import android.app.Activity;
 | 
				
			||||||
 | 
					import android.app.FragmentTransaction;
 | 
				
			||||||
import android.content.ComponentName;
 | 
					import android.content.ComponentName;
 | 
				
			||||||
import android.content.Context;
 | 
					import android.content.Context;
 | 
				
			||||||
import android.content.Intent;
 | 
					import android.content.Intent;
 | 
				
			||||||
@ -35,7 +36,12 @@ public class ProfileActivity extends Activity {
 | 
				
			|||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
					    protected void onCreate(Bundle savedInstanceState) {
 | 
				
			||||||
        super.onCreate(savedInstanceState);
 | 
					        super.onCreate(savedInstanceState);
 | 
				
			||||||
 | 
					        // This layout consists only of containers for fragments.
 | 
				
			||||||
        setContentView(R.layout.profile_activity);
 | 
					        setContentView(R.layout.profile_activity);
 | 
				
			||||||
 | 
					        // Fill the layout with the initial set of fragments.
 | 
				
			||||||
 | 
					        FragmentTransaction transaction = getFragmentManager().beginTransaction();
 | 
				
			||||||
 | 
					        transaction.add(R.id.list_fragment_container, new ProfileListFragment());
 | 
				
			||||||
 | 
					        transaction.commit();
 | 
				
			||||||
        // Ensure the long-running service is started. This only needs to happen once.
 | 
					        // Ensure the long-running service is started. This only needs to happen once.
 | 
				
			||||||
        Intent intent = new Intent(this, ProfileService.class);
 | 
					        Intent intent = new Intent(this, ProfileService.class);
 | 
				
			||||||
        startService(intent);
 | 
					        startService(intent);
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,5 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
 | 
					<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
				
			||||||
    android:id="@+id/profile_list_fragment"
 | 
					    android:id="@+id/list_fragment_container"
 | 
				
			||||||
    android:name="com.wireguard.android.ProfileListFragment"
 | 
					 | 
				
			||||||
    android:layout_width="match_parent"
 | 
					    android:layout_width="match_parent"
 | 
				
			||||||
    android:layout_height="match_parent" />
 | 
					    android:layout_height="match_parent" />
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user