
787 P.2d 1241 (1990)
SHERIFF, NYE COUNTY, Nevada, Appellant,
v.
Harold A. DAVIS, Respondent (two Cases).
Nos. 20062, 20237.
Supreme Court of Nevada.
February 27, 1990.
Philip H. Dunleavy, Dist. Atty., Nye County, for appellant (No. 20062).
Brian McKay, Atty. Gen., Brian R. Hutchins, Deputy Atty. Gen., Carson City, for appellant (No. 20237).
Peter L. Flangas, Las Vegas, for respondent.

OPINION
PER CURIAM:
As part of an ongoing dispute between respondent Nye County Sheriff Harold A. "Stick" Davis (Sheriff) and appellant[1] Nye County District Attorney Philip H. Dunleavy (District Attorney), the Sheriff agreed to resign. The District Attorney *1242 told the Sheriff that, if he withdrew his resignation, the District Attorney would press charges. The Sheriff withdrew his resignation on July 21, 1988. That same day, the District Attorney filed a criminal complaint against the Sheriff. The complaint contained numerous charges which were barred by the statute of limitations. It was amended on August 1, 1988, to exclude these time-barred charges.
On August 4, 1988, the Sheriff's attorney, Peter L. Flangas, informed the District Attorney that he intended to subpoena the District Attorney and his deputy. Flangas moved to disqualify the District Attorney's office from prosecuting the case because of Flangas' intent to call the prosecuting officers as witnesses. On October 10, 1988, his motion was denied. A preliminary examination was set for October 25, 1988. On October 18, 1988, Flangas did subpoena the District Attorney and his deputy. At that time, the District Attorney had known for over two months of Flangas' stated intention to issue the subpoenas.
On October 20, 1988, the District Attorney asked the attorney general's office to take over the case because of the potential ethical conflict, but the attorney general refused to take the case until authorized to do so by the Nye County Board of Commissioners. Because such authorization could not be obtained before the preliminary examination, and because the District Attorney's office wished to review new evidence and file a second amended complaint, on October 20, 1988, the District Attorney asked Flangas to stipulate to a continuance of the preliminary examination. Flangas refused and told the District Attorney that anything he wished to raise he would have to raise at the preliminary examination as scheduled.
The District Attorney then filed a motion for a continuance on October 21, 1988, and telephoned the justice of the peace, ex parte, to set up a telephone hearing to be conducted on October 24, 1988. The necessity for filing or granting a motion to shorten time was never discussed between the District Attorney and the justice of the peace. Nor did they discuss the need to show cause for making such a request without proper notice. On October 24, 1988, the District Attorney held a one-sided telephone "hearing" with the justice of the peace wherein he asked for a continuance and for leave to file a second amended complaint. The telephone hearing was held, without the presence or apparent knowledge of Flangas, the day before the preliminary examination. The justice of the peace granted the continuance because of the time needed to have the attorney general step in, because the District Attorney desired to amend the complaint, and because it would be inconvenient to travel all the way to the site of the preliminary examination just to grant a continuance. The District Attorney filed a second amended complaint immediately after the telephone hearing.
The next day, October 25, 1988, the Sheriff, Flangas, and their witnesses showed up for the preliminary examination as scheduled, only to find out that a continuance had been granted.
The Sheriff then filed a petition for a writ of habeas corpus. He alleged that by failing to proceed with the preliminary examination as scheduled, the justice court lost jurisdiction over the case and that he was therefore entitled to be released from custody[2] and to have the charges dismissed because the second amended complaint was void. A hearing on the writ of habeas corpus was held January 27, 1989. On February 15, 1989, the district judge ordered that the writ be made permanent. The District Attorney appealed that order to this court.
On February 9, 1989, after the hearing on the writ of habeas corpus but before the *1243 district judge issued the order making the writ permanent, the attorney general's office[3] filed a grand jury indictment which accused the Sheriff of two counts of obtaining money by false pretenses based on two travel expense claim numbers. These same claim numbers were the basis for two counts of obtaining money by false pretenses in the original proceedings. The Sheriff then filed a pretrial petition for a writ of habeas corpus. He alleged that he was illegally restrained of his liberty because the counts in the grand jury indictment were identical to charges brought in the original proceedings and were barred because of the prosecutorial abuse involved in the original proceedings. On May 23, 1989, the district judge ordered that the second writ be made permanent. The attorney general appealed that order to this court.
In his order making the first writ permanent, the district judge concluded that 1) the District Attorney acted in such a "willful or consciously indifferent manner" with regard to procedural rules affecting the Sheriff's rights that his conduct constituted prosecutorial abuse, and 2) the justice of the peace did not have jurisdiction to hear and decide the District Attorney's motion for a continuance.
We conclude that the district court correctly decided that the District Attorney committed prosecutorial abuse by acting in a "willful or consciously indifferent manner" with regard to the Sheriff's procedural rights. In Hill v. Sheriff, 85 Nev. 234, 235, 452 P.2d 918, 919 (1969), this court required that "good cause" be shown for securing the continuance of a preliminary examination. See also DCR 14. No good cause will be found where
there was a willful failure of the prosecution to comply with important procedural rules, Maes v. Sheriff, 86 Nev. 317, 468 P.2d 332 (1970), and where the prosecutor has exhibited a conscious indifference to rules of procedure affecting the defendant's rights, State v. Austin, 87 Nev. 81, 482 P.2d 284 (1971).
Bustos v. Sheriff, 87 Nev. 622, 623, 491 P.2d 1279, 1280 (1971).
In this case, the District Attorney filed charges which he knew or should have known were time barred. In addition, he admitted that his office had reviewed only about half of the new evidence. This indicates that he was unprepared for the preliminary examination. Also, the District Attorney created his own dilemma by not removing himself from the case sooner. He had known of Flangas' intention to subpoena him for over two months, yet took no action because he thought Flangas was bluffing. Taken together, these facts exhibit a conscious indifference to the Sheriff's procedural rights.
More importantly, the District Attorney's misconduct in seeking and holding an ex parte telephone "hearing" with the justice of the peace reveals a willful failure of the prosecution to comply with important procedural rules. Even though he knew that Flangas was adamantly opposed to a continuance, the District Attorney filed a motion for a continuance without an accompanying motion to shorten time and called the justice of the peace, ex parte, to set up this telephone "hearing." Although the District Attorney claims to have made attempts to contact Flangas that day, there is nothing to suggest that Flangas had actual notice of the hearing. Nevertheless, the hearing on a continuance was held, without the presence, participation, and perhaps knowledge of Flangas. Such conduct further demonstrates that no good cause for obtaining a continuance could have been demonstrated in this case; the district court correctly so held.
We further conclude that the district court correctly decided that the justice of the peace did not have jurisdiction to *1244 hear the District Attorney's motion for a continuance. Supreme Court Rule 174 prohibits ex parte communications between a lawyer and a judge. Furthermore, motions must be in writing with five days' notice unless "cause [is] shown." NRS 178.478(1), 178.476(1); see also DCR 14. In this case, the District Attorney and the justice of the peace engaged in more than one ex parte communication, during which the necessity for cause was never even discussed. Flangas was not notified or consulted; even if he had been, there would have been only one day's notice, not five. Fundamental due process requires, at a minimum, adequate notice to the accused and an opportunity to prepare for a hearing. See Nev. Const. art. 1, § 8; Farnow v. District Court, 64 Nev. 109, 126, 178 P.2d 371, 379 (1947). Having deprived the Sheriff of due process by denying him adequate notice, the justice of the peace had no jurisdiction to hold an ex parte hearing of this kind; the district court correctly so held.
In his order making the second writ permanent, the district judge concluded that 1) the offenses charged in the indictment were the same offenses charged in the original proceedings, and 2) the indictment was disallowed by the first writ even though the indictment was issued before the first writ was made permanent.
We conclude that the district court correctly decided that the offenses charged in the indictment were the same offenses charged in the original proceedings. In Maes v. Sheriff, 86 Nev. 317, 319, 468 P.2d 332, 333 (1970), this court stated: "A new proceeding for the same offense (whether by complaint, indictment or information) is not allowable when the original proceeding has been dismissed due to the willful failure of the prosecutor to comply with important procedural rules." As discussed above, the prosecutor willfully failed to comply with important procedural rules. We therefore turn to whether the new proceedings were for the "same offense."
Count I of the indictment charged the Sheriff with obtaining money by false pretenses on March 31, 1986, by filing travel expense claim number 23294; Count IX of the original proceedings charged the Sheriff with obtaining money by false pretenses on March 31, 1986, by filing claim number 23294. Similarly, Count II of the indictment charged the Sheriff with obtaining money by false pretenses on June 2, 1986, by filing travel expense claim number 25023; Count XI of the original proceedings charged the Sheriff with obtaining money by false pretenses on June 2, 1986, by filing travel expense claim number 25022.[4] At oral argument, counsel for the attorney general's office explained that the theory of proof anticipated by the original proceedings differed from the theory of proof anticipated by the indictment. Counsel stated that the original proceedings were premised on travel actually made but not subject to reimbursement; by contrast, the indictment was premised on reimbursement for travel which never took place. This distinction, however, is not apparent on the face of the pleadings; nor does it render the charges different. They are premised on the same statutory violation arising from the same claims made on the same days. They are therefore the same offense. Because the original proceedings were dismissed due to prosecutorial misconduct, these same offenses cannot be raised again; the district court correctly so held.
We also conclude that the district court correctly decided that the indictment was disallowed by the first writ even though the indictment was issued before the first writ was made permanent. Although the original proceedings had not yet "been dismissed" at the time of the indictment (see Maes, supra), the state was on notice of the likelihood that the writ of habeas corpus was going to be formally issued and the original proceedings dismissed because of prosecutorial abuse by *1245 the District Attorney. To allow the state to circumvent the rule by initiating a new proceeding for the same offense under such circumstances would be contrary to principles of judicial economy, fair play and reason, McNair v. Sheriff, 89 Nev. 434, 438, 514 P.2d 1175, 1177 (1973); the district court correctly so held.
For the reasons stated above, we find that the district judge properly granted both writs. Accordingly, we affirm the district court's decisions.
YOUNG, C.J., and STEFFEN, SPRINGER, and ROSE, JJ., and ADAMS,[5] District Judge, concur.
NOTES
[1]  The record in this case identifies the Sheriff of Nye County as the appellant and Harold Davis as the respondent, but Harold Davis is the Sheriff of Nye County. To avoid confusion, in this opinion "appellant" refers to the District Attorney or the attorney general. They are appealing the writs that were requested by and granted in favor of Sheriff Davis.
[2]  The Sheriff was "in custody" even though he had been released on his own recognizance. Constructive custody is sufficient to establish the restraint required by NRS 34.360; he is therefore entitled to pursue the remedy of habeas corpus. Franklin v. State, 89 Nev. 382, 383, 513 P.2d 1252, 1254 (1973).
[3]  On November 9, 1988, the Nye County Board of Commissioners passed a resolution authorizing the attorney general's office to take the case.
[4]  This was apparently a typographical error. The record contains no claim number 25022, but does contain claim number 25023 dated June 2, 1986.
[5]  The Honorable Brent T. Adams, Judge of the Second Judicial District, was designated by the Governor to sit in the place of the Honorable John Mowbray, Justice. Nev. Const. art. 6, § 4.
