Question: I am new Android and currently working on a project involving navigation between the activities within the tabbed activity(**HomeActivity**). I am stuck at a point where I have to navigate to a specific tab fragment, say **Tab 2**, from a button click event from **Activity2**. I have been stuck at this issue for a while now any help would be appreciated.

I have a **recyclerview** on **tab2** which should be loaded when the tab2 opens after the click event is performed from **activity2**.

I have researched about it for a while but was not able to come to a solution after trying various of them. I also found a similar question [here](https://stackoverflow.com/questions/33701042/starting-second-tab-fragment-of-first-activity-from-second-activity"). My code fragment is also similar to the one in the link but that is an unanswered question.

I have also looked [here](https://stackoverflow.com/questions/26657438/nested-fragments-and-viewpager-issues-on-android) and [here](https://stackoverflow.com/questions/16078278/trouble-with-viewpager-displaying-fragments).

I would appreciate if I can get some help in this matter.

Answer: 
You will need to store the form data, watch and then compare. This directive seems to that does that with a "modified" property which sounds like your "changed" property you are looking for. They have a plunker to test.

You could use a watch but if you want to re-use the code repeatedly you will need to create a directive to do the heavy lifting.

<https://github.com/betsol/angular-input-modified>
You can use `$watch` like so:

In your controller:

```
$scope.$watch('myForm', function(){
 console.log('Form Changed')
},true)

```

In your HTML:

```
<form name='myForm'>
        <input type="text" placeholder="Enter new name" ng-model="myForm.inputText" />
        <input type="text" placeholder="Other" ng-model="myForm.inputOther" />
        <input type="submit" />
    </form>

```